TMAPM

BlitzMax Forums/Brucey's Modules/TMAPM

Czar Flavius(Posted 2009) [#1]
Ok, I'm trying to avoid using floats and need a way to guarantee the result will be exactly the same on every computer in the universe, is this remotely the correct way to do it?

population :+ Int(TMAPM.CreateMAPM(String(population)).Multiply(TMAPM.CreateMAPM(String(growth_rate-shortage)).Divide(String(100), 2)).ToIntString());


population :+ population * (growth_rate-shortage)/100:Float


Of course, the decimal result for population can be castrated to an integer without worry ;)