Modification to implementation of round() such that it returns a float and accepts a places argument (fixes #3473).

This also involved moving some functions around to get the hierarchy correct and the documentation for frexp was modified such that it was clear that it can return a float in either the range [-1, -0.5] or [0.5, 1].
This commit is contained in:
A. S. Budden 2016-05-31 13:17:40 +01:00
commit 0cc7c9a13c
4 changed files with 74 additions and 27 deletions

View file

@ -489,7 +489,7 @@ proc leValueConv(a, b: PNode): bool =
of nkCharLit..nkUInt64Lit:
case b.kind
of nkCharLit..nkUInt64Lit: result = a.intVal <= b.intVal
of nkFloatLit..nkFloat128Lit: result = a.intVal <= round(b.floatVal)
of nkFloatLit..nkFloat128Lit: result = a.intVal <= round(b.floatVal).int
else: internalError(a.info, "leValueConv")
of nkFloatLit..nkFloat128Lit:
case b.kind