This PR restructures and extends the math.mc library. It moves most functions from math.mc into wither float.mc or int.mc.
Additions and changes to float.mc include the following.
Addition of a isNaN function that checks if a value is a nan. This required a change in the code generation for OCaml so that eqf t t will return false if t is a nan (this was not the case before).
Addition of a cmpf function that compares floats. This function equates nan with itself and orders floats so that nan is less than negative infinity.
Updates to several implementations to handle nan arguments.
This PR restructures and extends the
math.mc
library. It moves most functions frommath.mc
into witherfloat.mc
orint.mc
.Additions and changes to
float.mc
include the following.isNaN
function that checks if a value is anan
. This required a change in the code generation for OCaml so thateqf t t
will returnfalse
ift
is anan
(this was not the case before).cmpf
function that compares floats. This function equatesnan
with itself and orders floats so thatnan
is less than negative infinity.nan
arguments.https://github.com/miking-lang/miking-dppl/pull/161 should be merged together with this PR as this PR exposes a bug in the the cppl-to-mexpr compiler.