The result of the sum

The result of the sum - Messages

#1 Posted: 9/8/2024 1:22:56 AM
Prmtv

Prmtv

0 likes in 49 posts.

Group: User

Hello!


1) Why is the result of the sum not 0?
2) Why do different sum options differ (red from blue)?


011210.PNG

sum.sm (15 KiB) downloaded 26 time(s).
#2 Posted: 9/8/2024 4:35:15 AM
overlord

overlord

547 likes in 1330 posts.

Group: Moderator

That number practically means zero to programming languages.
Decimal numbers stored in smath as fractions.
In each iteration a small decimal part can be leftover.
When they are collected it makes result away from zero.
Putting an eval() to your calculation makes your results even smaller.

Click to expand

Changing exponent threshold to bigger makes your results zero by the way.

Click to expand

Regards

#3 Posted: 9/8/2024 1:19:38 PM
Prmtv

Prmtv

0 likes in 49 posts.

Group: User

Wrote

That number practically means zero to programming languages.
Decimal numbers stored in smath as fractions.
In each iteration a small decimal part can be leftover.
When they are collected it makes result away from zero.
Putting an eval() to your calculation makes your results even smaller.

Click to expand

Changing exponent threshold to bigger makes your results zero by the way.

Click to expand

Regards



With further calculations, the program will perceive it like 0 or will an error accumulate?
  • New Posts New Posts
  • No New Posts No New Posts