Mercurial > urweb
diff src/monoize.sml @ 390:519366a76603
num_float
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 21 Oct 2008 10:40:22 -0400 |
parents | acaf9d19fbb7 |
children | fe8f75f7e130 |
line wrap: on
line diff
--- a/src/monoize.sml Tue Oct 21 10:34:07 2008 -0400 +++ b/src/monoize.sml Tue Oct 21 10:40:22 2008 -0400 @@ -633,6 +633,25 @@ intBin "/", intBin "%") end + | L.EFfi ("Basis", "num_float") => + let + fun floatBin s = + (L'.EAbs ("x", (L'.TFfi ("Basis", "float"), loc), + (L'.TFun ((L'.TFfi ("Basis", "float"), loc), (L'.TFfi ("Basis", "float"), loc)), loc), + (L'.EAbs ("y", (L'.TFfi ("Basis", "float"), loc), + (L'.TFfi ("Basis", "float"), loc), + (L'.EBinop (s, (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc) + in + numEx ((L'.TFfi ("Basis", "float"), loc), + (L'.EAbs ("x", (L'.TFfi ("Basis", "float"), loc), + (L'.TFfi ("Basis", "float"), loc), + (L'.EUnop ("-", (L'.ERel 0, loc)), loc)), loc), + floatBin "+", + floatBin "-", + floatBin "*", + floatBin "/", + floatBin "fmod") + end | L.ECApp ((L.EFfi ("Basis", "show"), _), t) => let