Math::BigFloat reprise
C. Abney
cabney at ucsd.edu
Fri Dec 27 13:20:37 CST 2002
~sdpm~
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
anyone's
quicker at this than I am I'd appreciate your insight.
Code working the bug follows:
=8<============================================================
#! /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" );
$AOK->bsqrt();
print "bsqrt(AOK) = $AOK\n";
$NOK->bsqrt();
print "bsqrt(NOK) = $NOK\n";
=8<============================================================
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.
Yours,
CA
--
Charles Abney
Polymorphism Research Laboratory, 0603
UCSD School of Medicine
9500 Gilman Dr.
La Jolla, CA 92093-0603
~sdpm~
The posting address is: san-diego-pm-list at hfb.pm.org
List requests should be sent to: majordomo at hfb.pm.org
If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at happyfunball.pm.org> 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 happyfunball.pm.org> .
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