public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Gerrit P. Haase" <freeweb@nyckelpiga.de>
To: Tels <perl_dummy@bloodgate.com>
Cc: tphan@iqrinc.com, cygwin@cygwin.com, cpan-testers@perl.org
Subject: Re: Cygwin Perl and Module Math::BigInt
Date: Sun, 11 Nov 2001 08:26:00 -0000	[thread overview]
Message-ID: <8514151749.20011114212317@familiehaase.de> (raw)
In-Reply-To: <KLN303589B45@koeln.convey.de>

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

>>#----- Cygwin perl returns:  NaN
>>
>>#----- ActiveState perl returns :  -281474976710656

That is not correct, cygwin perl returns the same as Activestate:
#35:       got -281474976710656

with or without Math::BigInt->new().

>  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

;)

Gerrit
-- 
convey Information Systems GmbH                   http://www.convey.de/
                                                  Vitalisstraße 326-328
Gerrit P. Haase                                   D-50933 Köln
gerrit.haase@convey.de                            Fon: ++49 221 6903922


--
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/

       reply	other threads:[~2001-11-14 20:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <KLN303589B45@koeln.convey.de>
2001-11-11  8:26 ` Gerrit P. Haase [this message]
2001-11-11  8:26   ` Tels
2001-11-11  8:26   ` Tels
2001-11-11  8:26 Tels
  -- strict thread matches above, loose matches on Subject: below --
2001-11-11  8:26 Heribert Dahms
2001-08-06  9:03 Perl modules Timothy C. Phan
2001-08-10 13:41 ` Cygwin Perl and Module Math::BigInt T.Phan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8514151749.20011114212317@familiehaase.de \
    --to=freeweb@nyckelpiga.de \
    --cc=cpan-testers@perl.org \
    --cc=cygwin@cygwin.com \
    --cc=perl_dummy@bloodgate.com \
    --cc=tphan@iqrinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).