makes tests green again
This commit is contained in:
parent
0134a51a7c
commit
628ad4b753
1 changed files with 4 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue