You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Console.WriteLine($"We have four bytes (0x{makeAnIntFromBytes.A:X2}, 0x{makeAnIntFromBytes.B:X2}, 0x{makeAnIntFromBytes.C:X2}, 0x{makeAnIntFromBytes.D:X2}), we composed them into an integer (0x{makeAnIntFromBytes.UnsignedInteger:X8}).");
Console.WriteLine($"We have an integer (0x{makeBytesFromInt.UnsignedInteger:X8}) we divided into four bytes (0x{makeBytesFromInt.A:X2}, 0x{makeBytesFromInt.B:X2}, 0x{makeBytesFromInt.C:X2}, 0x{makeBytesFromInt.D:X2}).");
55
101
102
+
Section("Convert float to uint");
103
+
varfloatAndUint=newFloatAndUint();
104
+
floatAndUint.FloatValue=3.1415926f;
105
+
Console.WriteLine($"We have an float ({floatAndUint.FloatValue}) we can show as uint (in hex) = (0x{floatAndUint.UintValue:X4}).");
106
+
floatAndUint.UintValue=0x40490fda;//PI in IEEE-754 format
107
+
Console.WriteLine($"We have an uint (in hex) = (0x{floatAndUint.UintValue:X4}) we can show as float = ({floatAndUint.FloatValue}).");
108
+
109
+
Section("Convert double to ulong");
110
+
vardoubleAndUlong=newDoubleAndUlong();
111
+
doubleAndUlong.DoubleValue=Math.E;
112
+
Console.WriteLine($"We have an float ({doubleAndUlong.DoubleValue}) we can show as uint (in hex) = (0x{doubleAndUlong.UlongValue:X8}).");
113
+
doubleAndUlong.UlongValue=0x400921fb54442d18;//PI in IEEE-754 format
114
+
Console.WriteLine($"We have an uint (in hex) = (0x{doubleAndUlong.UlongValue:X8}) we can show as float = ({doubleAndUlong.DoubleValue}).");
Console.WriteLine($"We have an Fileheader (in hex) = (0x{enumInStruct.FileHeader:X4}), we can extract Attributes = ({enumInStruct.Attributes.ToString("g")}).");
0 commit comments