diff options
author | Araq <rumpf_a@web.de> | 2011-11-02 00:55:45 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-11-02 00:55:45 +0100 |
commit | 95df3ee1ce2303a7b5e2f728c643a86fb5e65561 (patch) | |
tree | ac153f70b3fffc6862e667ec745c41fb8d605215 /lib/pure | |
parent | 351e89e705c05bd9968010ab1af1674e7eda0d59 (diff) | |
parent | e1a82987af8a394e6bcb7a36c9a298074472db19 (diff) | |
download | Nim-95df3ee1ce2303a7b5e2f728c643a86fb5e65561.tar.gz |
Merge branch 'master' of github.com:Araq/Nimrod
Diffstat (limited to 'lib/pure')
-rwxr-xr-x | lib/pure/math.nim | 4 |
1 files changed, 2 insertions, 2 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) |