Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numbers: 2**10000000000 and 1/(2**10000) #4495

Closed
p6rt opened this issue Aug 29, 2015 · 12 comments
Closed

Numbers: 2**10000000000 and 1/(2**10000) #4495

p6rt opened this issue Aug 29, 2015 · 12 comments

Comments

@p6rt
Copy link

p6rt commented Aug 29, 2015

Migrated from rt.perl.org#125938 (status was 'resolved')

Searchable as RT125938$

@p6rt
Copy link
Author

p6rt commented Aug 29, 2015

From chrjae@gmail.com

2**10000000000 and 1/(2**10000) both silently return 0.

$ perl6 --version
This is perl6 version 2015.07.1-177-g5fb81ff built on MoarVM version
2015.07-68-g3240047

Christian.

@p6rt
Copy link
Author

p6rt commented Aug 29, 2015

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 18, 2016

From @coke

On Sat Aug 29 01​:59​:19 2015, chrjae@​gmail.com wrote​:

2**10000000000 and 1/(2**10000) both silently return 0.

$ perl6 --version
This is perl6 version 2015.07.1-177-g5fb81ff built on MoarVM version
2015.07-68-g3240047

Christian.

I get slightly different behavior​:

$ perl6 -e 'say 2**10000000000'
1
$ perl6 -e 'say 1/(2**10000)'
0
$ perl6 --version
This is Rakudo version 2016.02 built on MoarVM version 2016.02
implementing Perl 6.c.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Mar 18, 2016

From 1parrota@gmail.com

"I get slightly different behavior​:" - that's not surprising, given 7
months' difference between compiler versions.

The division's 0 is probably justified, depending on your definition
of epsilon ("Close enough for government work"), but is 1 a reasonable
substitute for "an implausibly large number"?

How far beyond the values of the physical universe does a practical
programming language need to go in pursuit of mathematical
consistency? 10 ** 100 appears to accommodate the number of protons in
the known universe with a good deal to spare.

On 3/18/16, Will Coleda via RT <perl6-bugs-followup@​perl.org> wrote​:

On Sat Aug 29 01​:59​:19 2015, chrjae@​gmail.com wrote​:

2**10000000000 and 1/(2**10000) both silently return 0.

$ perl6 --version
This is perl6 version 2015.07.1-177-g5fb81ff built on MoarVM version
2015.07-68-g3240047

Christian.

I get slightly different behavior​:

$ perl6 -e 'say 2**10000000000'
1
$ perl6 -e 'say 1/(2**10000)'
0
$ perl6 --version
This is Rakudo version 2016.02 built on MoarVM version 2016.02
implementing Perl 6.c.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Mar 18, 2016

From chrjae@gmail.com

2016-03-18 18​:40 GMT+00​:00 Parrot Raiser via RT <
perl6-bugs-followup@​perl.org>​:

but is 1 a reasonable substitute for "an implausibly large number"?

There's what I expect​:

$ perl -we 'print 2**10000000000,"\n"'
inf

@p6rt
Copy link
Author

p6rt commented Aug 24, 2016

From @zoffixznet

This now throws. Tests needed.

$ perl6 -e 'print 2**10000000000,"\n"'
Numeric overflow
  in block <unit> at -e line 1

Actually thrown at​:
  in block <unit> at -e line 1

@p6rt
Copy link
Author

p6rt commented Sep 10, 2016

From @zoffixznet

Tests added in Raku/roast@c7a560688a

@p6rt
Copy link
Author

p6rt commented Sep 10, 2016

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt
Copy link
Author

p6rt commented Sep 11, 2016

From @zoffixznet

Fudging tests and reopening as the issue appears to still exist on OSX​: http://irclog.perlgeek.de/perl6-dev/2016-09-11#i_13187953

@p6rt
Copy link
Author

p6rt commented Sep 11, 2016

@zoffixznet - Status changed from 'resolved' to 'open'

@p6rt
Copy link
Author

p6rt commented Dec 8, 2016

From @zoffixznet

On Sun, 11 Sep 2016 06​:04​:20 -0700, cpan@​zoffix.com wrote​:

Fudging tests and reopening as the issue appears to still exist on
OSX​: http://irclog.perlgeek.de/perl6-dev/2016-09-11#i_13187953

Closing per confirmation this is now fixed​: https://irclog.perlgeek.de/perl6-dev/2016-12-08#i_13704594

@p6rt
Copy link
Author

p6rt commented Dec 8, 2016

@zoffixznet - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant