#Missing something important when trying to round a float to 3 decimal places.

1 messages · Page 1 of 1 (latest)

strong marten
#

@patent jolt what numbers are different

patent jolt
#

so the Rounded & Attempt debugs print 1.668 - my expected value - but the value I see in the debug view is 1.667999...

#

though I should say I just found some other error that makes this post obsolete

strong marten
#

the numbers are literally the same lol

#

computers cannot represent all floating point numbers exactly

patent jolt
#

I thought the point of Math.Round would be to change the value from 1.667999999 to 1.668

#

using this I expected it to be 1.668 but it was debugging to be 1.6679999999

#

when I debug.log'd the value it was 1.668

#

made me very confused