How come math with decimals gives me results with too many digits?

השתנה ב ג', 28 יול ב- 4:33 אחר הצהריים

The problem you're seeing is a fundamental issue with how computers typically do math.  It is usually referred to as a floating-point error.  Essentially, it comes down to the fact that it is very hard to represent .1 in binary (or .01, etc.), and you have to do some work to round the results a computer gives you to make it more accurate.


This recently came up on the team, and we have been discussing how to handle it.  The Say bubbles do some rounding of numbers, but can lead to some inaccuracies.  The think bubble gives slightly different results, and right now the team isn't in total agreement about which is preferred.  You can try running your answers through the say bubble or the "round" blocks.  

Here is some more information on floating point math: https://0.30000000000000004.com/.
And here's a video that gives a good explanation of the topic: https://www.youtube.com/watch?v=PZRI1IfStY0

האם מאמר זה היה מועיל?

נהדר!

תודה על המשוב

מצטערים! לא יכולנו לעזור

תודה על המשוב

Liquid error: 783: unexpected token at '{ "label": "כתובת הדוא"ל שלך", "type": "email", "name": "helpdesk_ticket[email]", "id": "helpdesk_ticket_email", "required" : "true" } '

ספרו לנו כיצד נוכל לשפר את המאמר הזה!

בחרו לפחות אחת מהסיבות
אימות CAPTCHA נדרש.

המשוב נשלח

אנו מעריכים את המאמץ שלכם וננסה לתקן את המאמר