in reply to Re: Weird behavior of int()
in thread Weird behavior of int()
No, it wouldn't.
It silently converts some values to -1. This is only useful if you want to check if the number is representable by an IV.
It silently converts some positive values to negative values. This is only useful if you want to cast from unsigned to signed.
In both cases, it would be better if you used an approach that made it clear what you wanted to do instead.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Weird behavior of int()
by NERDVANA (Priest) on May 22, 2024 at 05:02 UTC |