[erlang-questions] floating point exception when accuracy exceeds limit
Erik Søe Sørensen
Tue Jan 20 12:10:42 CET 2015
What exactly do you mean by "accuracy"?
In very few applications would it "be better" to get an answer which is
orders of magnitude from the correct result, which is what you'd likely get
if you handled all overflows with "use the maximum representable value".
(For a better version of "No", wait till the sun reaches NZ; O'Keefe
usually has something eloquent to say then. :-))
Den 20/01/2015 11.49 skrev "Johan Montelius" <johanmon@REDACTED>:
> This might be no news to anyone who is doing a lot of floating point
> arithmetics but it made me scratch my head.
> 7> (6.0e150*6.0e150).
> 8> (6.0e154*6.0e154).
> ** exception error: an error occurred when evaluating an arithmetic
> in operator */2
> called as 6.0e154 * 6.0e154
> Hmm, would it not be better to answer with the highest possible accuracy?
> Assoc. Prof. Johan Montelius
> Software and Computer Systems
> School of Information and Communication Technology
> KTH - Royal Institute of Technology
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions