diff options
author | dom96 <dominikpicheta@googlemail.com> | 2011-10-31 15:39:01 +0000 |
---|---|---|
committer | dom96 <dominikpicheta@googlemail.com> | 2011-10-31 15:39:01 +0000 |
commit | e1a82987af8a394e6bcb7a36c9a298074472db19 (patch) | |
tree | 22f47f8d7216bd75193d06c0258bf8c1da741b23 /lib | |
parent | 15fcb58e2aff206ac051a6ab9afcacc05ec602c7 (diff) | |
download | Nim-e1a82987af8a394e6bcb7a36c9a298074472db19.tar.gz |
Fixed the tester. Some fixes and additions for the JS backend.
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/pure/math.nim | 4 | ||||
-rwxr-xr-x | lib/system/ecmasys.nim | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/pure/math.nim b/lib/pure/math.nim index c44d786b1..972b013c3 100755 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -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) diff --git a/lib/system/ecmasys.nim b/lib/system/ecmasys.nim index e0d7db2ef..9951811d1 100755 --- a/lib/system/ecmasys.nim +++ b/lib/system/ecmasys.nim @@ -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 |