Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

12.95 - 12 = .949999999999999 - FREAKY!


This topic is 7438 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

OK - this is starting to bother me. Is 12.95 minus 12 really .949999999999999? Can anyone explain what is going on here?

Try it for yourself. Create a number field (NumField) and put 12.95 in it. Then create a calculation that subtracts 12 from the NumField. What's the result? .949999999999999? Huh?

NumFormat.zip

Posted

Floating-point math, its actually done in base-2 (binary) not base ten (decimal), so the result doesn't always make sense back in the real world.

FM7 fixes this, math is done in base-10.

An interesting fact, 1/10 is infinitely repeating in binary form, since it cannot be cleanly represented as:

This topic is 7438 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.