Ok, not sure if this is me or not but this seems to be a bit of an oddity with float.
while debugging a bit of code to fade in and out text.
i came a cross too large a number for what I had added
here is an example
as you see i'm adding 0.05 the floaty (set to zero) i would expect this to increment in the following way
0, 0.05, 0.10, 0.15.... etcertera
this is what happens
the number is very slightly larger than it should be, why is this?
cheers.
while debugging a bit of code to fade in and out text.
i came a cross too large a number for what I had added
here is an example
SuperStrict Local floaty : Float = 0 For Local x : Int = 0 To 10 floaty :+ Float(0.05) Print floaty Next
as you see i'm adding 0.05 the floaty (set to zero) i would expect this to increment in the following way
0, 0.05, 0.10, 0.15.... etcertera
this is what happens
Building untitled2 Compiling:untitled2.bmx flat assembler version 1.64 3 passes, 2725 bytes. Linking:untitled2.debug.exe Executing:untitled2.debug.exe 0.0500000007 0.100000001 0.150000006 0.200000003 0.250000000 0.300000012 0.350000024 0.400000036 0.450000048 0.500000060 0.550000072 Process complete
the number is very slightly larger than it should be, why is this?
cheers.