Math::BigFloat reprise

C. Abney cabney at
Fri Dec 27 13:20:37 CST 2002

I also posted this one in clpmodules:

infinite loop (sometimes) in Math::BigFloat->bsqrt()

VERSION = 1.35 (according to the source)

I'm wading through BigFloat trying to see why it bsqrt() fails, if
quicker at this than I am I'd appreciate your insight.

Code working the bug follows:
#! /usr/bin/perl -w
# 20021227CAbney
# $Id$

use strict;
use Math::BigFloat;

my ( $AOK, $NOK );

$AOK = Math::BigFloat->new(
"0.000534658116517588658929262682872160412897552171548509046155298532422159361630992216149289020159041195738708426385817856" );
$NOK = Math::BigFloat->new(
"0.978749276884325796462284492928607873837710421811322137592267041496364208228589562026699599733496360862145221450960000001" );

print "bsqrt(AOK) = $AOK\n";
print "bsqrt(NOK) = $NOK\n";

I can't find anything particularly strange about the second number,
and in fact it'll bomb into the loop even if you truncate the number.


Charles Abney
Polymorphism Research Laboratory, 0603
UCSD School of Medicine
9500 Gilman Dr.
La Jolla, CA 92093-0603

The posting address is: san-diego-pm-list at

List requests should be sent to: majordomo at

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at> .
This is the general rule for most mailing lists when you need
to contact a human.

More information about the San-Diego-pm mailing list