Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
namespace FloatFloatTest {
class Program {
static void Main() {
float first = BitConverter.ToSingle(BitConverter.GetBytes(0x4540FDA8), 0);
float second = BitConverter.ToSingle(BitConverter.GetBytes(0x3E19A9C4), 0);
Console.WriteLine(BitConverter.ToString(BitConverter.GetBytes(first)) + " | " + first);
Console.WriteLine(BitConverter.ToString(BitConverter.GetBytes(second)) + " | " + second);
double result0 = first * second;
double result1 = first / second;
double result2 = first + second;
double result3 = first - second;
Console.WriteLine(BitConverter.ToString(BitConverter.GetBytes(result0)) + " | " + result0);
Console.WriteLine(BitConverter.ToString(BitConverter.GetBytes(result1)) + " | " + result1);
Console.WriteLine(BitConverter.ToString(BitConverter.GetBytes(result2)) + " | " + result2);
Console.WriteLine(BitConverter.ToString(BitConverter.GetBytes(result3)) + " | " + result3);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.