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

is-prime sub lies #4943

Closed
p6rt opened this issue Dec 27, 2015 · 5 comments
Closed

is-prime sub lies #4943

p6rt opened this issue Dec 27, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Dec 27, 2015

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

Searchable as RT127044$

@p6rt
Copy link
Author

p6rt commented Dec 27, 2015

From @zoffixznet

is-prime coerces its argument into an Int, which produces some false results​:

<ZoffixWin> m​: say is-prime (2.5)
<camelia> rakudo-moar 9441bb​: OUTPUT«True␤»
<ZoffixWin> m​: say is-prime '2.4242'
<camelia> rakudo-moar 9441bb​: OUTPUT«True␤»

Relevant IRC conversation​: http://irclog.perlgeek.de/perl6/2015-12-27#i_11785594

Code in question​: https://github.com/rakudo/rakudo/blob/b69aa55c5ca36d1df2f5c837df86a9daa50164dc/src/core/Int.pm#L392

@p6rt
Copy link
Author

p6rt commented Dec 27, 2015

From @zoffixznet

Sent a PR for this in Rakudo​: rakudo/rakudo#656 and added extra tests for this in roast​: Raku/roast#92

@p6rt
Copy link
Author

p6rt commented Dec 27, 2015

From @zoffixznet

This has been fixed in rakudo/rakudo@8c56c11

@p6rt
Copy link
Author

p6rt commented Dec 27, 2015

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

@p6rt p6rt closed this as completed Dec 27, 2015
@p6rt
Copy link
Author

p6rt commented Dec 28, 2015

From @lizmat

On 27 Dec 2015, at 17​:14, Zoffix Znet (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Zoffix Znet
# Please include the string​: [perl #​127044]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127044 >

is-prime coerces its argument into an Int, which produces some false results​:

<ZoffixWin> m​: say is-prime (2.5)
<camelia> rakudo-moar 9441bb​: OUTPUT«True␤»
<ZoffixWin> m​: say is-prime '2.4242'
<camelia> rakudo-moar 9441bb​: OUTPUT«True␤»

Relevant IRC conversation​: http://irclog.perlgeek.de/perl6/2015-12-27#i_11785594

Code in question​: https://github.com/rakudo/rakudo/blob/b69aa55c5ca36d1df2f5c837df86a9daa50164dc/src/core/Int.pm#L392

Fixed with 8c56c1114cc63eeb8554403f2c , tests already added by Zoffix, can be closed.

Liz

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