For positive numbers int(15/2) + 1 probably also works, but the docs for int discourage this use.use POSIX qw(ceil); print ceil (15/2);
Update: Actually, int(15/2) + 1 will not work very well at all, because int(14/2)+1 also produces 8, whereas you want 7 (I guess). Sorry to have brought it up...
In reply to Re: integer operations
by Thilosophy
in thread integer operations
by wannabeboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |