mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 15:31:28 +00:00
makes tests green again
This commit is contained in:
@@ -15,8 +15,9 @@ template toFloatHelper(result: expr; tooSmall, tooLarge: stmt) {.immediate.} =
|
||||
tooLarge
|
||||
|
||||
proc toFloat*(a: int): float =
|
||||
toFloatHelper(result)
|
||||
do: raise newException(ValueError, "number too small"):
|
||||
raise newException(ValueError, "number too large")
|
||||
toFloatHelper(result) do:
|
||||
raise newException(ValueError, "number too small")
|
||||
do:
|
||||
raise newException(ValueError, "number too large")
|
||||
|
||||
echo toFloat(8)
|
||||
|
||||
Reference in New Issue
Block a user