Merge branch 'master' of github.com:Araq/Nimrod

This commit is contained in:
Araq 2011-11-02 00:55:45 +01:00
commit 95df3ee1ce
4 changed files with 14 additions and 13 deletions

View file

@ -190,7 +190,7 @@ when not defined(ECMAScript):
else:
proc mathrandom(): float {.importc: "Math.random", nodecl.}
proc floor*(x: float): float {.importc: "Math.floor", nodecl.}
proc random*(max: int): int = return floor(mathrandom() * max)
proc random*(max: int): int = return int(floor(mathrandom() * float(max)))
proc randomize*() = nil
proc sqrt*(x: float): float {.importc: "Math.sqrt", nodecl.}
@ -204,7 +204,7 @@ else:
proc frexp*(x: float, exponent: var int): float =
if x == 0.0:
exponent = 0.0
exponent = 0
result = 0.0
elif x < 0.0:
result = -frexp(-x, exponent)

View file

@ -7,7 +7,8 @@
# distribution, for details about the copyright.
#
proc alert(s: cstring) {.importc, nodecl.}
proc alert*(s: cstring) {.importc, nodecl.}
proc log*(s: cstring) {.importc: "console.log", nodecl.}
type
PSafePoint = ptr TSafePoint