Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 664

Bugs & Feature Suggestions • [BUG?] Floating Point Imprecision

$
0
0
I remember it was probably in these threads

https://forum.rainmeter.net/viewtopic.php?t=42416
https://forum.rainmeter.net/viewtopic.php?t=40251
https://forum.rainmeter.net/viewtopic.php?t=36112
https://forum.rainmeter.net/viewtopic.php?t=31054
https://forum.rainmeter.net/viewtopic.php?t=24399#p129442

From this thread:
https://forum.rainmeter.net/viewtopic.php?t=35984#p182711
“The reason is because of how numbers are stored in Rainmeter. Every measure's number value is stored as a floating point number and when converted to a string, it can sometimes include extra decimal points. So a number like "12", can be represented internally like "12.0000000001". These conversions can cause the regular expression to fail.”
Thanks for looking for those threads, now it really seems like I'm rambling the same thing in different ways over and over again... :oops:

The explanation is spot on, and I've faced similar issues in my Earth "skin" written in Javascript, having to go back and forth between numbers and strings to conserve precision (which I eventually did, in spite of everything, and for similar numbers). Anyway, it's crazy that I can't even get (Ceil(Abs(Log(Abs(1-Frac(65534.999)))))) to yield 3 and not 4, even though I really lowered the bar from 4294967295.999.

Obviously, it's not necessarily Rainmeter's fault, but this means that we'd have to stick with rudimentar operations (addition, subtraction, nothing fancy) on very small numbers, or risk having a wrong result going forward. :???:

Statistics: Posted by Yincognito — August 1st, 2024, 4:50 pm — Replies 2 — Views 133



Viewing all articles
Browse latest Browse all 664

Trending Articles