public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Cygwin Perl and Module Math::BigInt
  2001-11-11  8:26 ` Cygwin Perl and Module Math::BigInt Gerrit P. Haase
  2001-11-11  8:26   ` Tels
@ 2001-11-11  8:26   ` Tels
  1 sibling, 0 replies; 6+ messages in thread
From: Tels @ 2001-11-11  8:26 UTC (permalink / raw)
  To: Gerrit P. Haase

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin Perl and Module Math::BigInt
  2001-11-11  8:26 ` Cygwin Perl and Module Math::BigInt Gerrit P. Haase
@ 2001-11-11  8:26   ` Tels
  2001-11-11  8:26   ` Tels
  1 sibling, 0 replies; 6+ messages in thread
From: Tels @ 2001-11-11  8:26 UTC (permalink / raw)
  To: cygwin; +Cc: tphan, Gerrit

-----BEGIN PGP SIGNED MESSAGE-----

Moin,

okay, I repeat my question because it got lost somehow:

On 14-Nov-01 Gerrit P. Haase tried to scribble about:
> Hallo Tels,
> Without Math::BigInt->new() (I added several print statements):
> $ perl t/06bigint.t

What is this? Which tests are you running? I need to know that to
investigate the failures, otherwise I can't fix it.


> 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

Cheers,


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"'
 seamlessly engineer plug-and-play users



-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: latin1

iQEVAwUBO/PsJ3cLPEOTuEwVAQEQ9wf/SoCIUhTCGtN13+qk2YxGMQHsfHbPpiFP
fPZ8w44Dr/u98HWa6OHBxx84MR23NfUqubN6FVIrV9YMG8m+O3Rvcv2rCi96EjvY
Iz5X2rtdEmdohIRgmtIlL6lpbxKJAHrasHKu/+hm1NFOVM0fyFlV3aTnrLX7csTB
cWgHKcgEh6ESJJDHSwZrCsvHuwB+tSFqvpe+tyjCHrZ7NUyz/VSTTwCGyc60CAYB
fVwnpOgSei5k16/AhvGVKcqfA9Anmf5Lvbn65fAQAzRqerFms1b+m8LMwTkWIiyH
5T4iXUDULimUc/APmzL29pGQJes3Chz1qW2tQoapKY50JkapgRstHw==
=hHLa
-----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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Cygwin Perl and Module Math::BigInt
       [not found] <KLN303589B45@koeln.convey.de>
@ 2001-11-11  8:26 ` Gerrit P. Haase
  2001-11-11  8:26   ` Tels
  2001-11-11  8:26   ` Tels
  0 siblings, 2 replies; 6+ messages in thread
From: Gerrit P. Haase @ 2001-11-11  8:26 UTC (permalink / raw)
  To: Tels; +Cc: tphan, cygwin, cpan-testers

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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Cygwin Perl and Module Math::BigInt
@ 2001-11-11  8:26 Heribert Dahms
  0 siblings, 0 replies; 6+ messages in thread
From: Heribert Dahms @ 2001-11-11  8:26 UTC (permalink / raw)
  To: 'Tels', tphan; +Cc: cygwin

Hi Tels,

I don't speak Perl, but in C that would overflow the temporary
expression calculated before it is passed as an argument to new()!
Try: my $num = Math::BigInt->new(-1 * (1<<24)) * Math::BigInt->new(1<<24);

Bye, Heribert (heribert_dahms@icon-scm.com)

> -----Original Message-----
> From:	Tels [SMTP:perl_dummy@bloodgate.com]
> Sent:	Wednesday, November 14, 2001 19:35
> To:	tphan@iqrinc.com
> Cc:	cygwin@cygwin.com
> Subject:	Cygwin Perl and Module Math::BigInt
> 
	[Heribert]  [snip]

> >my $num = Math::BigInt->new(-1 * (1<<24) * (1<<24));
> 

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Cygwin Perl and Module Math::BigInt
@ 2001-11-11  8:26 Tels
  0 siblings, 0 replies; 6+ messages in thread
From: Tels @ 2001-11-11  8:26 UTC (permalink / raw)
  To: tphan; +Cc: cygwin

-----BEGIN PGP SIGNED MESSAGE-----

Moin,

[sorry for the late reply, I don't read this list]

"T.Phan" <tphan at iqrinc dot com> wrote on Fri, 10 Aug 2001 15:38:11 -0500:

>Hi, 
>  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?

Thanx in advance,


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"'
 proactively transform compelling infrastructures



-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: latin1

iQEVAwUBO/K5L3cLPEOTuEwVAQHrOQf+M4IVe+GTJ4BaIFN2AEWPtG6C7ep814hg
EDfkP7pCijRudhpW4WCWhdpmKaDHwYS7bmGj9jhK/LpawlRUR9qd0zvsiJFjZdD6
baLCRjzzPszwWKZNh3FQbEpcaj512mlucJaa26orJaNaoBrTsqwOGAS2J3aa80hK
OChtyPOV9+pLrWqP53MJUiOeYuaBqjxEvuB6abIanA4RFUmknKT/X1SpihkUVS81
dAK9YOwLRr7pO5No7gafMkIyfSLsF7Ywc4DW7N4idytargEX/IVTXz6jKxbjn/jx
vWKwniZWRAGz5kUu0L5YYj96Fq7VrQK+XIN/PtRcdllca7Kkjv0Msw==
=dySO
-----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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Cygwin Perl and Module  Math::BigInt
  2001-08-06  9:03 Perl modules Timothy C. Phan
@ 2001-08-10 13:41 ` T.Phan
  0 siblings, 0 replies; 6+ messages in thread
From: T.Phan @ 2001-08-10 13:41 UTC (permalink / raw)
  To: cygwin

Hi, 

  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!


---
tcp

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-11-15 16:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <KLN303589B45@koeln.convey.de>
2001-11-11  8:26 ` Cygwin Perl and Module Math::BigInt Gerrit P. Haase
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

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).