[vienna.pm] Seltsame String-Konversion
Peter J. Holzer
hjp-vienna-pm-list at hjp.at
Mon Feb 25 03:34:31 CST 2002
On 2002-02-25 08:45:13 +0100, Marcel Gruenauer wrote:
> On Mon, Feb 25, 2002 at 01:16:16AM +0100, Peter J. Holzer wrote:
> > Kann mir jemand erklären, was das soll?
> >
> > teal:~/tmp 0:58 109% perl -e 'print "0x030004" + 0, "\n" '
> > 1.50003051757812
> > teal:~/tmp 0:59 110% perl -e 'print "0x040002" + 0, "\n"'
> > 1.00000762939453
>
> [marcelgr at localhost marcelgr]$ perl -e 'print "0x040002" + 0, "\n"'
> 0
> [marcelgr at localhost marcelgr]$ perl -e 'print "0x030004" + 0, "\n" '
> 0
>
> Das ist 5.6.0 auf OS X. Welche Version verwendest Du?
This is perl, v5.6.0 built for i686-linux
und
This is perl, version 5.005_03 built for i386-linux
Beides auf Redhat 6.x, also mit glibc 2.1.
Noch ein bißchen herumprobieren:
titan:/wsrdb/users/hjp 10:09 101% perl -e 'print "0x030004" + 0, "\n" '
0
titan:/wsrdb/users/hjp 10:09 102% perl -v
This is perl, v5.6.1 built for PA-RISC2.0
titan:/wsrdb/users/hjp 10:10 103% uname -a
HP-UX titan B.11.00 U 9000/899 unknown
legolas:~ 10:10 64% perl -e 'print "0x030004" + 0, "\n" '
196612
legolas:~ 10:10 65% perl -v
This is perl, v5.6.0 built for i386-linux
legolas:~ 10:11 66% cat /etc/redhat-release
Red Hat Linux release 7.2 (Enigma)
Super. 3 verschiedene Ergebnisse auf 4 verschiedenen Rechnern. Scheint
von der strtod-Implementation abzuhängen, jedenfalls liefert ein kleines
C-Testprogramm, das strtod auf den gleichen String aufruft, jeweils die
gleichen Werte. Offenbar haben die glibc-Implementierer da eine
"Erweiterung" eingebaut.
> We are Perl. Your table will be assimilated.
Erinnert mich irgendwie an das LUGA-Treffen letzte Woche.
hp
--
_ | Peter J. Holzer | Heuer's Law:
|_|_) | Sysadmin WSR | Any feature which cannot be turned off
| | | hjp at hjp.at | is a bug.
__/ | http://www.hjp.at/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://mail.pm.org/archives/vienna-pm/attachments/20020225/8e2b966e/attachment.bin
More information about the Vienna-pm
mailing list