Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uptoInt doesn't raise an exception #2764
Comments
Araq
added
the
Documentation
label
Jul 1, 2015
This comment has been minimized.
This comment has been minimized.
I think we really like to inherit C's behaviour for these things. |
This comment has been minimized.
This comment has been minimized.
Which is? |
This comment has been minimized.
This comment has been minimized.
@Varriount I'm guessing: the current behaviour. |
added a commit
to narimiran/Nim
that referenced
this issue
Jan 3, 2019
narimiran
closed this
in
77166ba
Jan 4, 2019
added a commit
that referenced
this issue
Jan 4, 2019
This comment has been minimized.
This comment has been minimized.
/cc @dom96 @Varriount @Araq
|
timotheecour
changed the title
toInt doesn't raise an exception
[TODO] toInt doesn't raise an exception
Jan 4, 2019
This comment has been minimized.
This comment has been minimized.
Please dont add an overload, the default behavior should simply be changed. The issue is just that Nim doesnt do range checking for float to int conversions, and that should be fixed. There is an open issue for that somewhere. |
This comment has been minimized.
This comment has been minimized.
ya id prefer safety by default as well. do u have a link to issue? |
This comment has been minimized.
This comment has been minimized.
@timotheecour what does the "[TODO]" mean? Isn't it the equivalent of reopening this issue? |
This comment has been minimized.
This comment has been minimized.
@timotheecour Here's the issue for float range checking: #7179 |
This comment has been minimized.
This comment has been minimized.
@dom96 TODO means: there's something left to be done that is discussed in the thread
if #7179 now tracks this, I could remove the TODO from title, but doesn't seem like a dup |
This comment has been minimized.
This comment has been minimized.
TODO is just noise, nothing is ever perfect, so everything is TODO. |
Araq
changed the title
[TODO] toInt doesn't raise an exception
toInt doesn't raise an exception
Jan 5, 2019
This comment has been minimized.
This comment has been minimized.
it's not noise, it helps triaging for whoever needs to revisit un-addressed points at a later time (esp the issue author or commenter). |
def- commentedMay 20, 2015
While the documentation states that
toInt
raisesEInvalidValue
if the conversion fails (becausef
is infinite for example), I can't get an exception:Prints: