New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
toInt doesn't raise an exception #2764
Comments
I think we really like to inherit C's behaviour for these things. |
Which is? |
@Varriount I'm guessing: the current behaviour. |
/cc @dom96 @Varriount @Araq
|
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. |
ya id prefer safety by default as well. do u have a link to issue? |
@timotheecour what does the "[TODO]" mean? Isn't it the equivalent of reopening this issue? |
@timotheecour Here's the issue for float range checking: #7179 |
@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 |
TODO is just noise, nothing is ever perfect, so everything is TODO. |
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). |
While the documentation states that
toInt
raisesEInvalidValue
if the conversion fails (becausef
is infinite for example), I can't get an exception:Prints:
The text was updated successfully, but these errors were encountered: