Last active
August 17, 2020 09:59
-
-
Save nwjlyons/af444650813127ac9e6b04ada1dd523c to your computer and use it in GitHub Desktop.
Taking the square root of each number from 1 to 100, which of them are irrational
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enum.reject 1..100, fn i -> | |
square_root = Decimal.sqrt(i) | |
remainder = Decimal.rem(square_root, 1) | |
Decimal.eq?(remainder, 0) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment