Last active
September 9, 2024 21:43
-
-
Save assyrianic/7b5f5e434d798783532c2fb96746bae6 to your computer and use it in GitHub Desktop.
calculates epsilon for any device
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
func epsilon() float64 { | |
eps := 1.0 | |
for eps+1 > 1 { | |
eps /= 2 | |
} | |
eps *= 2 | |
return eps | |
} |
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
def epsil(): | |
eps = 1.0 | |
while eps+1 > 1: | |
eps /= 2 | |
eps *= 2 | |
return eps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment