Merge pull request #1448 from def-/posix-math

Add -lm for fesetround and fegetround
This commit is contained in:
Andreas Rumpf 2014-11-03 01:58:50 +01:00
commit a0ecfd19be
3 changed files with 113 additions and 53 deletions

View file

@ -40,17 +40,6 @@ const
## after the decimal point
## for Nimrod's ``float`` type.
type
TFloatClass* = enum ## describes the class a floating point value belongs to.
## This is the type that is returned by `classify`.
fcNormal, ## value is an ordinary nonzero floating point value
fcSubnormal, ## value is a subnormal (a very small) floating point value
fcZero, ## value is zero
fcNegZero, ## value is the negative zero
fcNan, ## value is Not-A-Number (NAN)
fcInf, ## value is positive infinity
fcNegInf ## value is negative infinity
proc classify*(x: float): TFloatClass =
## classifies a floating point value. Returns `x`'s class as specified by
## `TFloatClass`.