Fixed math.round, added math.ceil and fixed times.format.

This commit is contained in:
Dominik Picheta 2012-06-04 19:24:13 +01:00
commit 41a9a941ab
3 changed files with 5 additions and 3 deletions

View file

@ -186,10 +186,12 @@ when not defined(ECMAScript):
proc trunc*(x: float): float {.importc: "trunc", nodecl.}
proc floor*(x: float): float {.importc: "floor", nodecl.}
proc ceil*(x: float): float {.importc: "ceil", nodecl.}
else:
proc mathrandom(): float {.importc: "Math.random", nodecl.}
proc floor*(x: float): float {.importc: "Math.floor", nodecl.}
proc ceil*(x: float): float {.importc: "Math.ceil", nodecl.}
proc random*(max: int): int = return int(floor(mathrandom() * float(max)))
proc randomize*() = nil