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

Lua Scripting • Re: Decimals

$
0
0
Might be wrong with this, yet as far as I'm aware of, the precision is not really about the number of decimals, but the total amount of digits of some value, meaning more integer digits will result in less decimal ones, at least precise decimal ones. I wouldn't bother with more than 5 decimals though, because unless you need to multiply the value with a huge number afterwards and still have decimals, it won't decisively influence calculations. In other words, there are indeed cases where you absolutely need more decimals, but they are relatively few. In the astronomical calculations you probably need, choosing the suited unit (e.g. km instead of m, AU instead of km or the viceversas) with a limited number of decimals like 3 usually avoids the need for a large number of them.
That's correct, however I was interested in knowing whether lua was using more than five decimals or not because I wasn't able to display more than 5 decimals so I could check if the values were correct. Values like time T (which is used almost on every formula) needs to have at least 9 decimals for the moon calculations, since it's on centuries and during 0.000000001 century the moon moves over an arc of 1.7 arcseconds. In the book he uses 12 decimals and I wanted to compare how close my results were to his.

The accuracy on this astronomical calcs is more about "significant digits" than the actual n. of decimals.

Statistics: Posted by RicardoTM — 16 minutes ago



Viewing all articles
Browse latest Browse all 1486

Trending Articles