[erlang-questions] bignum sqrt broken in erlang?

Vlad Dumitrescu vladdu55@REDACTED
Tue Aug 25 15:39:52 CEST 2009


> 1> N=71641520761751435455133616475667090434063332228247871795429.
> 71641520761751435455133616475667090434063332228247871795429
>
> 2> R0=trunc(math:sqrt(N)).
> 267659337146589062070609641472

Hi,

math:sqrt() works with floats, and does some truncation.

2>R0*R0.
71641520761751431352030800763147494356059279996804382326784

which is not N.

regards,
Vlad


More information about the erlang-questions mailing list