Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up(^) can return 0.5 typed as an Int #960
Comments
rtfeldman
added
the
bug
label
May 15, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
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!
|
@lukewestby suggested in Slack that Thanks to @harfangk for finding the original issue and to @z5h for sharing it in Slack! |
rtfeldman
referenced this issue
May 15, 2018
Closed
(10 ^ -1) is considered an Int type by compiler #1704
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
ufocoder
referenced this issue
May 29, 2018
Closed
Change return type for exponentiation operation #962
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rtfeldman commentedMay 15, 2018
•
edited
Edited 2 times
-
rtfeldman
edited May 15, 2018 (most recent)
-
rtfeldman
edited May 15, 2018
SSCCE
This happens because
(^)currently has the typenumber -> number -> number, but if it receives a negative second argument, it returns a fraction even if both arguments have the typeInt.