Anders Blomberg Posted February 18, 2023 Share Posted February 18, 2023 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? Quote Link to comment
Marionette Maven Marissa Farrell Posted February 18, 2023 Marionette Maven Share Posted February 18, 2023 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: https://blog.codinghorror.com/why-do-computers-suck-at-math/ 3 Quote Link to comment
Pat Stanford Posted February 18, 2023 Share Posted February 18, 2023 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. 1 Quote Link to comment
AlanW Posted February 19, 2023 Share Posted February 19, 2023 (edited) Deleted Edited February 19, 2023 by AlanW Quote Link to comment
Anders Blomberg Posted February 19, 2023 Author Share Posted February 19, 2023 How weird, seems beyond my level. Got it sorted with a round node as suggested though and it works fine. Quote Link to comment
Recommended Posts
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.