Simple math question

Recommended Posts

I'm a little confused over some simple math numbers I'm getting with marionette, see below. To me, 3x0,3 should equal to exactly 0,9. Why am I getting another number?

• Marionette Maven

This falls into how computers do math, and is more complicated than I am able to explain. You can use a round node to specify the decimal places you would like your result rounded to.

Edit: here's an explanation on computers and floating point math:

Marissa is completely correct. The simplest explanation is that this is due to the conversion between Base 10 and Base 2 (decimal) numbers uses in the computer. Not all numbers can be exactly translated between the two bases without an infinite number of digits.

Just round to the accuracy that you need and move on.

Deleted

Edited by AlanW

How weird, seems beyond my level. Got it sorted with a round node as suggested though and it works fine.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×

• KBASE
• MARIONETTE

×
• Create New...