http://qs1969.pair.com?node_id=117054


in reply to Re: Approximating Square Roots
in thread Approximating Square Roots

There was an intermediate step where I was using bdiv() and badd() and the like. The results were the same. And with Math::BigFloat, once you've created a new() item, it isn't expressly necessary to use bdiv(), bpow(), etc. You can use standard math operators, which is what I chose to do in this most recent version simply for readability. It was easier (to me, at least) to follow the logic.
___________________
Kurt

Replies are listed 'Best First'.
Re: Approximating Square Roots
by Anonymous Monk on Nov 25, 2001 at 20:44 UTC
    Sorry for the late answer, found your question by chance via Google.
    You probably stumbled over one of the many bugs in the old BigFloat package. There is a newer, much improved version on CPAN, and you should give it a try. It also has a bsqrt() function, that actually works ;)
    use Math::BigFloat v1.22; $x = Math::BigFloat->new('1234.567'); print "square root of $x is ",$x->bsqrt(),"\n";
    HTH Tels

    If you have more questions, feel free to contact me at tels at bloodgate dot com. Thanxy!