User:Berni44/Floatingpoint
An introduction to floating point numbers
You probably already know, that strange things can happen, when using floating point numbers.
An example:
import std.stdio;
void main()
{
float a = 1000;
float b = 1/a;
float c = 1/b;
writeln("Is ",a," == ",c,"? ",a==c?"Yes!":"No!");
}
Did you guess the answer?
Is 1000 == 1000? No!
Nano floats
To understand this strange behavior we have to look at the bit representation of the numbers involved.
... to be continued