This commit is contained in:
commit
568474d52f
1591 files changed
+528213
No files matched your search
@@ -0,0 +1,11 @@
|
||||
# probe: with contraction on (--fp-mode contract=fast, Mojo's default; the pin builds with it off), does the compiler fuse a * b - c into one rounding when the operands are literals? (fused, 0.1 * 10.0 - 1.0 is 5.551115123125783e-17; rounded twice it is 0.0)
|
||||
# args: --fp-mode contract=fast
|
||||
def fused(a: Float64, b: Float64, c: Float64) -> Float64:
|
||||
return a * b - c
|
||||
|
||||
|
||||
def main():
|
||||
var a = 0.1
|
||||
var b = 10.0
|
||||
var c = 1.0
|
||||
print(a * b - c, fused(a, b, c))
|
||||
Reference in new issue
Block a user