Fix several float range issues
This commit is contained in:
parent
66a8856152
commit
def6234903
5 changed files with 30 additions and 3 deletions
|
|
@ -292,6 +292,9 @@ proc fitRemoveHiddenConv(c: PContext, typ: PType, n: PNode): PNode =
|
|||
result = newFloatNode(nkFloatLit, BiggestFloat r1.intVal)
|
||||
result.info = n.info
|
||||
result.typ = typ
|
||||
if not floatRangeCheck(result.floatVal, typ):
|
||||
localError(c.config, n.info, "cannot convert " & $result.floatVal &
|
||||
" to " & typeToString(typ))
|
||||
else:
|
||||
changeType(c, r1, typ, check=true)
|
||||
result = r1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue