From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25892 invoked by alias); 14 Nov 2001 23:35:33 -0000 Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@sources.redhat.com Received: (qmail 25801 invoked from network); 14 Nov 2001 23:35:27 -0000 Received: from unknown (HELO relay.pair.com) (209.68.1.20) by sourceware.cygnus.com with SMTP; 14 Nov 2001 23:35:27 -0000 Received: (qmail 49864 invoked from network); 14 Nov 2001 23:35:25 -0000 Received: from pd9e146db.dip.t-dialin.net (HELO null) (217.225.70.219) by relay1.pair.com with SMTP; 14 Nov 2001 23:35:25 -0000 X-pair-Authenticated: 217.225.70.219 X-Mailer: XFMail 1.4.0 on Linux X-Priority: 3 (Normal) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <8514151749.20011114212317@familiehaase.de> Date: Sun, 11 Nov 2001 08:26:00 -0000 Organization: none From: Tels To: "Gerrit P. Haase" Subject: Re: Cygwin Perl and Module Math::BigInt X-SW-Source: 2001-11/txt/msg00245.txt.bz2 Message-ID: <20011111082600.TQ1sRc-26T27U4fNE-_yU7QhBj6OHIeiWIG-uXvfBSU@z> -----BEGIN PGP SIGNED MESSAGE----- Moin, On 14-Nov-01 Gerrit P. Haase tried to scribble about: > Hallo Tels, > 2001-11-14 21:12:13, du schriebst: > >>> I tried to 'make test' on the the Convert:ASN1 and it kept fail at >>> place where the Math::BigInt always returns NaN. >>> >>> I cut out the segment below and ran it and sure enough, it return >>> NaN in Cygwin Perl. However, the same script return a number in >>> ActiveState Perl: >>> >>>#-------------------------- >>>use strict; >>>use Math::BigInt; >>> >>>my $num = Math::BigInt->new(-1 * (1<<24) * (1<<24)); >>> >>>print "$num\n"; >>> >>>exit; >>> >>>#----- Cygwin perl returns: NaN >>> >>>#----- ActiveState perl returns : -281474976710656 >>> >>> Any idea how to fix this in Cygwin? Thank in advance! > >> The scalar probably overflowed and returned "NaN" so that BigInt also >> produced a "NaN". > >> On my Linux 32 bit box it produces the same number than Activestate. > >> What version of Bigint do you have? And what does Perl print without the >> bigInt->new() around the expression? > > Without Math::BigInt->new() (I added several print statements): > > $ perl t/06bigint.t > 1..35 > [...] > $num is now: -2.8147497671066e+14 >#32: expecting hex:0207ff000000000000 >#32: got hex:0207fefffffffffffc >#line 93 t/06bigint.t > not ok 32 > ok 33 > ok 34 >#35: expecting -2.8147497671066e+14 >#35: got -281474976710656 >#line 96 t/06bigint.t > not ok 35 > > If I change it back: > > $num is now: -281474976710660 >#32: expecting hex:0207ff000000000000 >#32: got hex:0207fefffffffffffc >#line 90 t/06bigint.t > not ok 32 > ok 33 > ok 34 >#35: expecting -281474976710660 >#35: got -281474976710656 >#line 93 t/06bigint.t > not ok 35 Ah! I didn't know about these failures. Were do they occur? In bleadperl? In previous Perl versions, or in my latest release? Or is this inside Convert:ASN1? >>>#----- Cygwin perl returns: NaN >>>#----- ActiveState perl returns : -281474976710656 > That is not correct, cygwin perl returns the same as Activestate: >#35: got -281474976710656 So, it got fixed in the meantime, or you have a different Cygwin platform than the original poster ;) > with or without Math::BigInt->new(). Thew new() shouldn't actually change the value of the expression, otherwise I did bad work ;) >> perl -MDev::Bollocks -e'print Dev::Bollocks->rand(),"\n"' > cnt: 5 for 1 sum: 1 > cnt: 5 for 2 sum: 1 > cnt: 5 for 3 sum: 2509 > cnt: 5 for 4 sum: 205657 > return 4 > autoschediastically scale B2C CEOs Sorry, I accidentily forgot to disable some debug output in Math::String v1.16. Will be fixed in v1.17 whenever I find time to tidy up the new release ;) Tels - -- "Why do you go so slowly? Do you think this is some kind of game?" PGP key available on http://bloodgate.com/tels.asc or via email. perl -MDev::Bollocks -e'print Dev::Bollocks->rand(),"\n"' apprehensively promote professional markets -----BEGIN PGP SIGNATURE----- Version: 2.6.3i Charset: latin1 iQEVAwUBO/L+yncLPEOTuEwVAQEWzAf/VaDsnexgD+G30Y0xlmcG/enZcTuPgHJR UoMHWv12QDQjE+Jxw920l4ZunHvsIHXyPFxac/DVi4lV0QO0Loh8P7Wm9BiYysr7 n3S1LjNXVydUvhpuOXroSniONzTFL/c5vIkahqHeJ8QJTrnbA7xf6SLUFeP/5gFF OtnUr6RIn+3mj6Cs8z5xuc5rY6Xi4HTzvsLSmOfnlgmkj5PyrXghKeNV6jsKtup/ uhpr4BAtLVWf1lWR+afR7YnOouUdm6Vn9yACJU/MzHaHNzEo4AkYvKwPqsPQ8FrI 9o4j640rKUvarJpB/jyUDc/h6fnunVBOpsKRHpRNeJxj35MiaO1ZEg== =Uel9 -----END PGP SIGNATURE----- -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/