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

.int-bounds on Ranges with large Num end points is faulty #6385

Closed
p6rt opened this issue Jul 7, 2017 · 5 comments
Closed

.int-bounds on Ranges with large Num end points is faulty #6385

p6rt opened this issue Jul 7, 2017 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jul 7, 2017

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

Searchable as RT131718$

@p6rt
Copy link
Author

p6rt commented Jul 7, 2017

From @zoffixznet

Ranges with large Num end points still let .int-bounds to succeed, because
the .floor == $_ (or .Int == $_) check checks out. The real Int number, however, has noise in it​:

  <Zoffix_> m​: say (1e100..1e200).int-bounds
  <camelia> rakudo-moar c76d93​: OUTPUT​: «(10000000000000000159028911097599180468360808563945281389781327557747838772170381060813469985856815104 9999999999999999697331222125103616594745032754550236264824175095034684843555407553419633840470625186802751241597388240818213573436827848463938504104723…»

This creates problems such as naive code like this successfully returns a sum. It's a very noisy sum and isn't what a user[^1] expected​:

  <Zoffix_> m​: say [+] 1..1e100
  <camelia> rakudo-moar c76d93​: OUTPUT​: «50000000000000001590289110975991817328705368083504703036502630629001320386155388099280879870478387696492219464257418736194801727938851902336988862645587616123664360879667548673664253072454494149672960␤»

I dunno, is the floating point noise something the user should be familiar with or should we somehow go extra length to prevent such cases and error out or something?

[1] https://irclog.perlgeek.de/perl6/2017-07-07#i_14841814

@p6rt
Copy link
Author

p6rt commented Jul 7, 2017

From 1parrota@gmail.com

Isn't there a point at which there's no obvious practical application
for extreme numbers? It's all very well letting mathematicians romp
around unconstrained, but is it worth complicating the language or its
development for the rest of us?

@p6rt
Copy link
Author

p6rt commented Jul 7, 2017

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

@p6rt
Copy link
Author

p6rt commented Jul 8, 2017

From @zoffixznet

On Fri, 07 Jul 2017 16​:38​:13 -0700, 1parrota@​gmail.com wrote​:

Isn't there a point at which there's no obvious practical application
for extreme numbers? It's all very well letting mathematicians romp
around unconstrained, but is it worth complicating the language or its
development for the rest of us?

Yeah, after thinking more about it, it's just not worth it trying rake all the values and figure out whether user really meant to get any f.p. noise in the numbers. Rejecting, same as https://rt-archive.perl.org/perl6/Ticket/Display.html?id=131717#txn-1472555

@p6rt
Copy link
Author

p6rt commented Jul 8, 2017

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

@p6rt p6rt closed this as completed Jul 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant