Double.fma doesn't return a value and breaks subsequent code in certain cases. It does, however, always compile.
Example program:
fun main () =
let
val a = (Double.fromString "1.0")
val b = (Double.fromString "2.0")
val c = (Double.fromString "3.0")
val r = (Double.fma a b c)
val r2 = (Double.+ a r)
in
print ((Double.toString a) ^ "\nHello, World!\n")
end;
main ();
As expected, this program prints:
1.000000000000
Hello, World!
However, attempting to print the results of fma by replacing (Double.toString a) with (Double.toString r), results in no output.
Additionally, attempting to print the results of later mathematical operations involving the result of fma with (Double.toString r2), results in no output.
Double.fma doesn't return a value and breaks subsequent code in certain cases. It does, however, always compile.
Example program:
As expected, this program prints:
However, attempting to print the results of fma by replacing
(Double.toString a)
with(Double.toString r)
, results in no output.Additionally, attempting to print the results of later mathematical operations involving the result of fma with
(Double.toString r2)
, results in no output.