in reply to Re^6: Weird behavior of int()
in thread Weird behavior of int()
Your particular trunc might have that behaviour, but trunc general might not.
The spec simply describes trunc as follows:
The trunc functions round their argument to the integer value, in floating format, nearest to but no larger in magnitude than the argument.
The spec simply describes what it returns as follows:
The trunc functions return the truncated integer value.
Passing an infinity or a NaN is therefore undefined behaviour. Anything could happen.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Weird behavior of int()
by pryrt (Abbot) on May 21, 2024 at 23:38 UTC | |
by ikegami (Patriarch) on May 22, 2024 at 14:12 UTC | |
by pryrt (Abbot) on May 22, 2024 at 17:10 UTC |