[erlang-questions] math:pow(X, Y).

Michael Turner michael.eugene.turner@REDACTED
Tue Mar 20 11:10:51 CET 2012


"As these are the C library, the bugs are the same."

I'm not sure what the IEEE floating point spec says about cases where
you've exceeded what can be represented in double precision floating
point, in computing an exponential. "Bad argument" might not be the
best way to express what went wrong, but something is definitely wrong
with the computation itself: you can't express a number that big in
IEEE double precision. Maybe the exception thrown in the standard is
something like "bad argument."

-michael turner

On Tue, Mar 20, 2012 at 3:23 AM, Matthias Lang <matthias@REDACTED> wrote:
> On Monday, March 19, Jared Kofron wrote:
>
>> Just a guess, but math:pow/2 is implemented as a NIF and C may not
>> enjoy the size of the number you are trying to calculate.
>
> Exactly.
>
> The bottom of the 'math' manpage sort of says so, under 'bugs':
>
>  "As these are the C library, the bugs are the same."
>
> Matt
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list