#1
10th Sep 2021 at 10:03 PM
Posts: 1,129
Thanks: 108 in 1 Posts
3 Achievements
How do you deal with divisions (and precision)?
So...
because it's too late to be brave and die young, maybe it's time to be brave and die old fool, apparently
The problem in the title is addresing pretty trivial thing, but may have non-trivial approaches. SimAnt uses integer (just like any ASM) as a fundamental numeral which is simple and fast as long as you do not need to make a proportion or divide a numeral resulting in non-integer outcome (quotient and remainder, SA by default rounds to low numeral e.g. 3/2 will always give 1 just like 16/10 will) which is fine but suboptimal if you need better precision.
Because inventing the whell once again is not very practical, an actual question: is there some established practice by experience in the matter?*
*yes I am aware about existing algorithms, including dirty ones (multiply by 10, get the last digit, compare); the point of the question is: is there a solution practical (fast, efficient with low overload) for SimAnt implementations?
favorite quote: "When ElaineNualla is posting..I always read..Nutella. I am sorry" by Rosebine
self-claimed "lower-spec simmer"