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

(^) can return 0.5 typed as an Int #960

Open
rtfeldman opened this Issue May 15, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@rtfeldman
Member

rtfeldman commented May 15, 2018

SSCCE

> (floor 2) ^ -1
0.5 : Int

This happens because (^) currently has the type number -> number -> number, but if it receives a negative second argument, it returns a fraction even if both arguments have the type Int.

@rtfeldman rtfeldman added the bug label May 15, 2018

@rtfeldman

This comment has been minimized.

Show comment
Hide comment
@rtfeldman

rtfeldman May 15, 2018

Member

@lukewestby suggested in Slack that (^) having a return type of Float would be better.

Thanks to @harfangk for finding the original issue and to @z5h for sharing it in Slack!

Member

rtfeldman commented May 15, 2018

@lukewestby suggested in Slack that (^) having a return type of Float would be better.

Thanks to @harfangk for finding the original issue and to @z5h for sharing it in Slack!

@rtfeldman rtfeldman changed the title from (^) can return `0.5` typed as an `Int` to (^) can return 0.5 typed as an Int May 15, 2018

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