9 lines
310 B
Mojo
9 lines
310 B
Mojo
# probe: how accurate are ** with a fractional exponent, exp and sqrt on a Float64? (true values: 1.4142135623730951 2.718281828459045 0.36787944117144233 1.4142135623730951)
|
|
from std.math import exp, sqrt
|
|
|
|
|
|
def main():
|
|
var two = 2.0
|
|
var one = 1.0
|
|
print(two ** 0.5, exp(one), exp(-one), sqrt(two))
|