Fixed math.round, added math.ceil and fixed times.format.
This commit is contained in:
parent
4105a91c48
commit
41a9a941ab
3 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue