[erlang-questions] math:pow(X, Y).
Mon Mar 19 18:26:02 CET 2012
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.
Here's GHCI's answer:
On Mar 19, 2012, at 10:17 AM, Yves S. Garret wrote:
> Hi all,
> That's the standard method that I use to raise a value to a power. I compared this to the way Python does raising to a power and this is the result that I get:
> 11> math:pow(42, 909).
> ** exception error: bad argument in an arithmetic expression
> in function math:pow/2
> called as math:pow(42,909)
> Now. Why is it in Erlang's case I get a float as a return value? Is there a method that only returns a long? Or do most erlang coders have a custom power function if they want ridiculously large numbers?
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions