Last active
April 19, 2017 02:45
-
-
Save tyabu12/187dddfa963987d4c9eb385f20210983 to your computer and use it in GitHub Desktop.
This file contains 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
let print x y z = | |
let print_line mode mode_name = | |
Printf.printf " round %s:\n x + y = %.18e\n x + z = %.18e\n" | |
mode_name (Round.add mode x y) (Round.add mode x z) in | |
Printf.printf "x = %e, y = %e, z = %e\n" x y z; | |
print_line Round.NearestTiesToEven "NearestTiesToEven"; | |
print_line Round.ToZero "ToZero"; | |
print_line Round.Up "Up"; | |
print_line Round.Down "Down"; | |
Printf.printf "\n" | |
let _ = | |
print 1.0 1e-40 (-1e-40); | |
print (-1.0) 1e-40 (-1e-40) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment