develooper Front page | perl.perl5.porters | Postings from August 2013

[perl #23731] infinity is formatted with leading spaces e.g. " Inf"

Thread Next
From:
Brian Fraser via RT
Date:
August 7, 2013 07:59
Subject:
[perl #23731] infinity is formatted with leading spaces e.g. " Inf"
Message ID:
rt-3.6.HEAD-22538-1375862369-898.23731-15-0@perl.org
On Thu Sep 04 17:46:28 2003, dcd wrote:
> 
> This is a bug report for perl from david.dyck@fluke.com,
> generated with the help of perlbug 1.34 running under perl v5.9.0.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> I tried to use CPAN's Set::Infinite, which seems to
> care about the string representation of infinity.
> 
> On my computer perl reports
> 
> perl -wle 'print q(").(100**100**100).q(")'
> "            Inf"
> 
> It's my guess that this may be a libc5 issue, but does
> perl have a standard way that it proposed to export
> the infinity string to it's client scripts?
> 
> My old perl3 and perl4 binaries also
> print the same string for infinity as
> perl5.9.0.
> 
> The following test program in C doesn't display
> the leading spaces, why does perl?
> 
>     int main() {
> 	long linf = 0x7f800000;
> 	printf( "<%g>\n", *(float*) &linf);
> 	return 0;
>     }
> 
> which prints
> <Inf>
> 
> 
> 
> [Please do not change anything below this line]
> -----------------------------------------------------------------
> ---
> Flags:
>     category=core
>     severity=medium
> ---
> Site configuration information for perl v5.9.0:
> 
> Configured by dcd at Thu Sep  4 15:03:57 PDT 2003.
> 
> Summary of my perl5 (revision 5.0 version 9 subversion 0 patch 21036)
>    configuration:
>   Platform:
>     osname=linux, osvers=2.4.23pre1, archname=i686-linux
>     uname='linux dd 2.4.23pre1 #2 wed aug 27 11:20:37 pdt 2003 i686 '
>     config_args='-Dmksymlinks -Dinstallusrbinperl -Uversiononly
>    -Dusedevel -Doptimize=-O3 -g -de -Dcf_email=david.dyck@fluke.com'
>     hint=recommended, useposix=true, d_sigaction=define
>     usethreads=undef useithreads=undef usemultiplicity=undef
>     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
>     use64bitint=undef use64bitall=undef uselongdouble=undef
>     usemymalloc=n, bincompat5005=undef
>   Compiler:
>     cc='cc', ccflags ='-DDEBUGGING -fno-strict-aliasing
>    -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
>     optimize='-O3 -g',
>     cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
>     ccversion='', gccversion='egcs-2.91.66.1 19990314/Linux (egcs-
>    1.1.2 release)', gccosandvers=''
>     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
>     d_longlong=define, longlongsize=8, d_longdbl=define,
>    longdblsize=12
>     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
>    lseeksize=4
>     alignbytes=4, prototype=define
>   Linker and Libraries:
>     ld='cc', ldflags =' -L/usr/local/lib'
>     libpth=/usr/local/lib /lib /usr/lib
>     libs=-lgdbm -ldbm -ldb -ldl -lm -lc
>     perllibs=-ldl -lm -lc
>     libc=/lib/libc.so.5.4.44, so=so, useshrplib=false,
>    libperl=libperl.a
>     gnulibc_version=''
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-
>    rdynamic'
>     cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
> 
> Locally applied patches:
>     DEVEL20173
> 
> ---
> @INC for perl v5.9.0:
>     /usr/local/lib/perl5/5.9.0/i686-linux
>     /usr/local/lib/perl5/5.9.0
>     /usr/local/lib/perl5/site_perl/5.9.0/i686-linux
>     /usr/local/lib/perl5/site_perl/5.9.0
>     /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
>     /usr/local/lib/perl5/site_perl/5.8.0
>     /usr/local/lib/perl5/site_perl
>     .
> 
> ---
> Environment for perl v5.9.0:
>     HOME=/home/dcd
>     LANG (unset)
>     LANGUAGE (unset)
>     LD_LIBRARY_PATH (unset)
>     LOGDIR (unset)
>    
PATH=/home/dcd/bin:/sbin:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/games:/usr/local/samba:/home/hobbes/tools/scripts:/home/hobbes/tools/linux:/usr0/hobbes/tools/scripts:/usr0/dcd/bin:/apps/general/bin:/usr/public
>     PERL5_CPANPLUS_CONFIG=/home/dcd/.cpanplus/config
>     PERL_BADLANG (unset)
>     SHELL=/bin/bash

This bug report hasn't seen any activity in seven years. I can't
reproduce the leading spaces on any OS that I have at hand*, and the
value of d_Gconvert looks drastically different too. Short of someone
being able to reproduce this, can we close the ticket?

[*]
Ubuntu 11.04 & 13.04:
"inf"

Archlinux:
"inf"

Debian wheezy:
"inf"

CentOS 5.6 & 6:
"inf"

OpenSUSE:
"inf"

Gentoo:
"inf"

Android 4.0.4:
"Inf"

Mac OS X 10.8.4:
"inf"

QNX Neutrino:
"inf"

Windows Server 2008:
"1.#INF"

Windows Server 2008, cygwin:
"inf"

Syllable:
"inf"

Haiku:
"inf"

Solaris 11:
"Infinity"

OmniOS:
"Infinity"

FreeBSD 9.0:
"inf"

NetBSD 5.1.2:
"inf"

OpenBSD 5.0:
"inf"

--hugmeir


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=23731

Thread Next


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