From e1a82987af8a394e6bcb7a36c9a298074472db19 Mon Sep 17 00:00:00 2001 From: dom96 Date: Mon, 31 Oct 2011 15:39:01 +0000 Subject: Fixed the tester. Some fixes and additions for the JS backend. --- lib/pure/math.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/pure') 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) -- cgit 1.4.1-2-gfad0