You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently our conversion functions like int(), uint() will silently give a wrong answer if you try to convert a value that does not fit into the destination type. Here's an example:
$ flux repl
> uint(v: -1)
18446744073709551615
We should add a parameter to these functions that specify what to do if the input value does not fit. By default we can keep the current behavior. Here's a possible way to do it:
$ flux repl
> uint(v: -1, errOnOverflow: true)
Error: cannot represent value -1 as an uint
DOD: numeric conversion functions provide a way to error on overflow, and have related tests
The text was updated successfully, but these errors were encountered:
Currently our conversion functions like
int()
,uint()
will silently give a wrong answer if you try to convert a value that does not fit into the destination type. Here's an example:We should add a parameter to these functions that specify what to do if the input value does not fit. By default we can keep the current behavior. Here's a possible way to do it:
DOD: numeric conversion functions provide a way to error on overflow, and have related tests
The text was updated successfully, but these errors were encountered: