🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #1702

Enteros de 64 bits en Perl (era: Re: scipt ftp)

#1702
From: David Serrano (Hue-Bond)
Date: Tue, 30 Aug 2005 16:58
33 lines
1978 bytes
gamo, mar20050830@16:32:38(CEST):
>
> perl -e 'print 111_111_111**2,"\n";'

$ perl -e 'print 111_111_111**2,"\n";'
1.23456789876543e+16

"Hmm, ¿y sin notación científica?"

$ perl -e 'printf "%u\n", 111_111_111**2'
4294967295
$ perl -e 'printf "%llu\n", 111_111_111**2'
4294967295

Probé Math::BigInt y el resultado es el mismo. Lo más que me he conseguido
aproximar es:

$ perl -e 'printf "%.17g\n", 111_111_111**2'
12345678987654320
$ perl -e 'printf "%.f\n", 111_111_111**2'
12345678987654320

Pero entonces tenemos los fallos inherentes a la coma flotante. Mi versión
de Perl es 5.8.7 en un x86.

$ perl -V|grep 64bit
    use64bitint=undef use64bitall=undef uselongdouble=undef

Con este hardware y esta versión no puedo hacer nada, verdad?


-- 
 David Serrano
Technical Details
Message-ID: <slrndh9411.aqi.responder_solo_en_el_grupo@genus.hue-bond.info>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-xfer.cox.net!peer01.cox.net!cox.net!antonio.escomposlinux.org!cernicalo.escomposlinux.org!escomposlinux.org!not-for-mail
References: <3niq8hF1o8odU1@individual.net> <Pine.LNX.4.63.0508301628070.27280@jvz.es>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,217cb3188ddb1207
X-Google-Attributes: gidf86c8,public
X-Google-Language: SPANISH,UTF8
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news-xfer.cox.net!peer01.cox.net!cox.net!antonio.escomposlinux.org!cernicalo.escomposlinux.org!escomposlinux.org!not-for-mail
From: "David Serrano (Hue-Bond)" <responder_solo_en_el_grupo@yahoo.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Enteros de 64 bits en Perl (era: Re: scipt ftp)
Date: Tue, 30 Aug 2005 16:58:09 +0000 (UTC)
Organization: I work for myself
Lines: 33
Message-ID: <slrndh9411.aqi.responder_solo_en_el_grupo@genus.hue-bond.info>
References: <3niq8hF1o8odU1@individual.net> <Pine.LNX.4.63.0508301628070.27280@jvz.es>
NNTP-Posting-Host: 84.77.11.99
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: cormoran.emeteo.local 1125421089 10404 84.77.11.99 (30 Aug 2005 16:58:09 GMT)
X-Complaints-To: emeteo@escomposlinux.org
NNTP-Posting-Date: Tue, 30 Aug 2005 16:58:09 +0000 (UTC)
X-Message-Flag: Visit http://www.debian.org/
X-MSMail-Priority: High
Mail-Copies-To: nobody
User-Agent: slrn/0.9.8.1pl1 (Debian)