In message <[EMAIL PROTECTED]> (on 21 November 2004 08:34:44 -0500), [EMAIL PROTECTED] (Ed Allen Smith) wrote: >In message <[EMAIL PROTECTED]> (on 21 >November 2004 08:25:57 -0500), [EMAIL PROTECTED] >([EMAIL PROTECTED]) wrote: >>This distribution has been tested as part of the cpan-testers >>effort to test as many new uploads to CPAN as possible. See >>http://testers.cpan.org/
>>I suspect I may wind up installing this anyway: On second thought, with FastCalc, the following coredumps with a SIGSEGV: use Math::BigFloat lib => 'FastCalc'; use warnings; Math::BigInt->accuracy(undef); Math::BigInt->precision(undef); Math::BigInt->div_scale(53*2); Math::BigFloat->accuracy(undef); Math::BigFloat->precision(undef); Math::BigFloat->div_scale(53*2); $num1 = new Math::BigFloat "212810988215683677989664967567559"; $num2 = new Math::BigFloat "5097575504458999984164528930580800"; $num3 = new Math::BigFloat "-559451250909552448081850892236801"; $num4 = new Math::BigFloat "45878179540130999857480760375227200"; $num5 = Math::BigInt::blcm($num2,$num4); $num1_mult = $num5/$num2; $num3_mult = $num5/$num4; $num = (($num1*$num1_mult)+($num3*$num3_mult))/$num5; print $num->bstr() . "\n"; $num->bround(53); print $num->bstr() . "\n"; Stack trace: Perl_av_len(<stripped>) ["av.c":677, 0x100cd070] XS_Math__BigInt__FastCalc__is_zero(<stripped>) ["FastCalc.xs":375, 0x09f550bc] Perl_pp_entersub(<stripped>) ["pp_hot.c":2773, 0x100983a0] Perl_runops_debug(<stripped>) ["dump.c":1398, 0x1011c228] S_run_body(<stripped>) ["perl.c":1681, 0x100c4f74] perl_run(<stripped>) ["perl.c":1600, 0x100c4b00] main(<stripped>) ["perlmain.c":85, 0x1001dbf4] __start(<stripped>) ["crt1text.s":177, 0x1001dae8] With Calc: Can't use an undefined value as an ARRAY reference at /usr/share/lib/perl5/5.8.0/Math/BigInt/Calc.pm line 980. The following, which should be equivalent, does not coredump or give an error and produces, as far as I can tell, the correct result: use Math::BigFloat (lib => 'FastCalc'); use warnings; Math::BigInt->accuracy(undef); Math::BigInt->precision(undef); Math::BigInt->div_scale(53*2); Math::BigFloat->accuracy(undef); Math::BigFloat->precision(undef); Math::BigFloat->div_scale(53*2); $num1 = new Math::BigInt "212810988215683677989664967567559"; $num2 = new Math::BigInt "5097575504458999984164528930580800"; $num3 = new Math::BigInt "-559451250909552448081850892236801"; $num4 = new Math::BigInt "45878179540130999857480760375227200"; $num5 = Math::BigInt::blcm($num2,$num4); $num1_mult = $num5/$num2; $num3_mult = $num5/$num4; $num6 = (($num1*$num1_mult)+($num3*$num3_mult)); $num7 = new Math::BigFloat $num6->bstr(); $num = $num7/$num5; print $num->bstr() . "\n"; $num->bround(53); print $num->bstr() . "\n"; >>-- >> >>Summary of my perl5 (revision 5.0 version 8 subversion 0 patch 17881) >>configuration: >> Platform: >> osname=irix, osvers=6.5, archname=IP30-irix-thread-multi-64int-ld >> uname='irix64 puck2 6.5 04101931 ip30 ' >> config_args='-DDEBUGGING -Dusemorebits -Dcc=cc -n32 -mips4 -r10000 >> -TARG:platform=ip30:processor=r10000 -Wl,-woff,84 -woff 1009,1110,1047' >> hint=recommended, useposix=true, d_sigaction=define >> usethreads=define use5005threads=undef useithreads=define >> usemultiplicity=define >> useperlio=define d_sfio=undef uselargefiles=define usesocks=undef >> use64bitint=define use64bitall=undef uselongdouble=define >> usemymalloc=n, bincompat5005=undef >> Compiler: >> cc='cc -n32 -mips4 -r10000 -TARG:platform=ip30:processor=r10000 >> -Wl,-woff,84 -woff 1009,1110,1047', ccflags ='-DDEBUGGING -D_SGI_SOURCE >> -D_SGI_REENTRANT_FUNCTIONS -D_SGIAPI -D_POSIX1C >> -I/server/people/staff/easmith/include -DPTHREAD_H_FIRST -D_BSD_TYPES >> -D_BSD_TIME -woff 1184,1552 -DLANGUAGE_C -DHAS_LDBL_SPRINTF_BUG >> -DHAS_LDBL_SPRINTF_BUG_LESS1', >> optimize='-O3 -OPT:fast_exp=ON:Olimit=0 -TENV:X=1 >> -LNO:opt=1:ou_further=3:gather_scatter=2 >> -OPT:fold_unsafe_relops=OFF:div_split=OFF:IEEE_arithmetic=1:roundoff=0 >> -OPT:got_call_conversion=OFF:space=OFF', >> cppflags='-DDEBUGGING -D_SGI_SOURCE -D_SGI_REENTRANT_FUNCTIONS -D_SGIAPI >> -D_POSIX1C -I/server/people/staff/easmith/include -DPTHREAD_H_FIRST >> -D_BSD_TYPES -D_BSD_TIME -DLANGUAGE_C -DHAS_LDBL_SPRINTF_BUG >> -DHAS_LDBL_SPRINTF_BUG_LESS1' >> ccversion='MIPSpro Compilers: Version 7.3.1.3m', gccversion='', >> gccosandvers='' >> intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321 >> d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 >> ivtype='long long', ivsize=8, nvtype='long double', nvsize=16, >> Off_t='off_t', lseeksize=8 >> alignbytes=16, prototype=define >> Linker and Libraries: >> ld='ld -mips4 -n32 -woff 84', ldflags >> ='-L/server/people/staff/easmith/lib32 -L/usr/lib32/mips4 -L/usr/lib32 >> -L/lib32 -rpath >> /server/people/staff/easmith/lib32:/usr/lib32/mips4:/usr/lib32:/lib32 >> -Wl,-woff,84' >> libpth=/server/people/staff/easmith/lib32 /usr/lib32/mips4 /usr/lib32 >> /lib32 >> libs=-lgdbm -ldb -lm -lpthread >> perllibs=-lm -lpthread >> libc=/usr/lib32/libc.so, so=so, useshrplib=false, libperl=libperl.a >> gnulibc_version='' >> Dynamic Linking: >> dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' >> cccdlflags=' ', lddlflags='-shared -check_registry >> /usr/lib32/so_locations -L/server/people/staff/easmith/lib32 >> -L/usr/lib32/mips4 -L/usr/lib32 -L/lib32' >> > >-- >Allen Smith http://cesario.rutgers.edu/easmith/ >There is only one sound argument for democracy, and that is the argument >that it is a crime for any man to hold himself out as better than other men, >and, above all, a most heinous offense for him to prove it. - H. L. Mencken > -- Allen Smith http://cesario.rutgers.edu/easmith/ February 1, 2003 Space Shuttle Columbia Ad Astra Per Aspera To The Stars Through Asperity
