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

my int gets confused with goldilocks number #3319

Closed
p6rt opened this issue Jan 23, 2014 · 6 comments
Closed

my int gets confused with goldilocks number #3319

p6rt opened this issue Jan 23, 2014 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jan 23, 2014

Migrated from rt.perl.org#121071 (status was 'rejected')

Searchable as RT121071$

@p6rt
Copy link
Author

p6rt commented Jan 23, 2014

From @coke

16​:20 < [Coke]> r​: my int $a = 2**50;
16​:20 <+camelia> rakudo-jvm f4b0fb, rakudo-moar f4b0fb​: ( no output )
16​:20 <+camelia> ..rakudo-parrot f4b0fb​: OUTPUT«===SORRY!===␤Error while
compiling op bind​:
  Cannot infer type from '1125899906842624'␤»

Any exponent between 50 and 59 causes the error - anything lower or higher
compiles fine.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jan 23, 2014

From @Util

The low edge is 10**15, whether expressed as 10**X or all digits.

$ p6s -e 'my int $a = 999_999_999_999_999;'
$ p6s -e 'my int $a = 1_000_000_000_000_000;'
  ===SORRY!===
  Error while compiling block (source text​: "my int $a = 1_000_000_000_000_000;")​: Error while compiling op call​: Error while compiling block : Error while compiling op bind​: Cannot infer type from '1000000000000000'
$ p6s -e 'my int $a = 10**15 - 1;'
$ p6s -e 'my int $a = 10**15;'
  ===SORRY!===
  Error while compiling block (source text​: "my int $a = 10**15;")​: Error while compiling op call​: Error while compiling block : Error while compiling op bind​: Cannot infer type from '1000000000000000'

@p6rt
Copy link
Author

p6rt commented Jan 23, 2014

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 23, 2014

From @Util

The low edge is 10**15, whether expressed as 10**X or all digits.
The high edge is 2**60, whether expressed as 2**X or all digits.
Strange that the low and high edges are not both powers of 10 or both powers of 2.

$ p6s -e 'my int $a = 999_999_999_999_999;'
$ p6s -e 'my int $a = 1_000_000_000_000_000;'
  ===SORRY!===
  Error while compiling block (source text​: "my int $a = 1_000_000_000_000_000;")​: Error while compiling op call​: Error while compiling block : Error while compiling op bind​: Cannot infer type from '1000000000000000'
$ p6s -e 'my int $a = 10**15 - 1;'
$ p6s -e 'my int $a = 10**15;'
  ===SORRY!===
  Error while compiling block (source text​: "my int $a = 10**15;")​: Error while compiling op call​: Error while compiling block : Error while compiling op bind​: Cannot infer type from '1000000000000000'

$ p6s -e 'my int $a = 1_152_921_504_606_846_976;'
$ p6s -e 'my int $a = 1_152_921_504_606_846_975;'
  ===SORRY!===
  Error while compiling block (source text​: "my int $a = 1_152_921_504_606_846_975;")​: Error while compiling op call​: Error while compiling block : Error while compiling op bind​: Cannot infer type from '1152921504606846975'
$ p6s -e 'my int $a = 2**60;'
$ p6s -e 'my int $a = 2**60 - 1;'
  ===SORRY!===
  Error while compiling block (source text​: "my int $a = 2**60 - 1;")​: Error while compiling op call​: Error while compiling block : Error while compiling op bind​: Cannot infer type from '1152921504606846975'

@p6rt
Copy link
Author

p6rt commented Mar 12, 2015

From @usev6

This works on MoarVM and JVM. I added a test to S02-types/native.t with commit Raku/roast@1a72d75.

Since support for Parrot was suspended with Rakudo Star Release 2015.02, I'm closing this "parrot only" ticket.

I'll add the ticket to a list of closed ticket living in the mu repository​: https://github.com/perl6/mu/blob/master/misc/rt.perl.org/tickets_closed_parrot_only.txt.

In case support for Parrot will be restored in some future release the listed tickets can be checked and re-opened as appropriate.

@p6rt
Copy link
Author

p6rt commented Mar 12, 2015

@usev6 - Status changed from 'open' to 'rejected'

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