develooper Front page | perl.perl5.porters | Postings from March 2000

[ID 20000316.002] Math::BigInt and string ops

From:
Matthias Urlichs
Date:
March 16, 2000 02:59
Subject:
[ID 20000316.002] Math::BigInt and string ops
Message ID:
38D0BE71.19295.qmail@play.smurf.noris.de
This is a bug report for perl from smurf@noris.net,
generated with the help of perlbug 1.26 running under perl 5.006.


-----------------------------------------------------------------
[Please enter your report here]

$ perl -e 'use Math::BigInt;
           $foo = new Math::BigInt 12345;
           $foo =~ s/^\+//;
           print "$foo\n";
           $foo = int($foo/10+0.5);
           print "$foo\n"; '
+12345
NaN

*Sigh* Under 5.005, the above code was a legitimate method to convert
$foo to a normal string/number/whatever, thus the above code actually
printed

12345
1235

instead. Can we please reinstate the old behavior?

Incidentally, it seems that the ability to overload s/// would be rather
nice. The method would get the new value as input, and should return
either a new object which stringifies to that value, or the original
string, which is then assigned to the left-hand side of the =~.

[Please do not change anything below this line]
-----------------------------------------------------------------

---
This perlbug was built using Perl 5.00503 - Mon Aug 30 23:08:56 EDT 1999
It is being executed now by  Perl 5.006 - Mon Mar 13 11:48:30 CET 2000.

Site configuration information for perl 5.006:

Configured by smurf at Mon Mar 13 11:48:30 CET 2000.

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.15-2.5.0smp, archname=i686-linux-thread-multi-64all
    uname='linux play.smurf.noris.de 2.2.15-2.5.0smp #1 smp sat feb 5 00:21:58 est 2000 i686 unknown '
    config_args='-Uusenm -Duseshrplib=true -Dman1dir=/usr/man/man1 -Dman3dir=/usr/man/man3 -Dstartperl=#!/usr/bin/perl -Dprefix=/usr/lib/perl -d -e -Dcf_email=smurf@noris.net -Dman1ext=1p -Dman3ext=3p -Dusemultiplicity -Dusethreads -Duseithreads -Duse64bitall -Duselargefiles -Dd_dosuid -Duselongdouble'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=define use64bitall=define uselongdouble=define usesocks=undef
  Compiler:
    cc='cc', optimize='-O2 -g', gccversion=2.95.2 19991024 (release)
    cppflags='-D_REENTRANT -fno-strict-aliasing'
    ccflags ='-D_REENTRANT -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt
    libc=/lib/libc-2.1.2.so, so=so, useshrplib=true, libperl=libperl.so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl/lib/5.6.0/i686-linux-thread-multi-64all/CORE'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:
    

---
@INC for perl 5.006:
    /usr/lib/perl/lib/5.6.0/i686-linux-thread-multi-64all
    /usr/lib/perl/lib/5.6.0
    /usr/lib/perl/lib/site_perl/5.6.0/i686-linux-thread-multi-64all
    /usr/lib/perl/lib/site_perl/5.6.0
    /usr/lib/perl/lib/site_perl/5.005
    /usr/lib/perl/lib/site_perl
    .

---
Environment for perl 5.006:
    HOME=/smurf/home
    LANG=en_US
    LANGUAGE (unset)
    LC_ALL=en_US
    LC_CTYPE=C
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/pop/bin:/pop/bin:/usr/src/STATUS/bin:/smurf/home/bin:/usr/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/X11R6/bin:/usr/X11R6/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About