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.
In reply to Re^7: Weird behavior of int()
by ikegami
in thread Weird behavior of int()
by cLive ;-)
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |