=over
=item int EXPR
X X X X X
=item int
Returns the integer portion of EXPR. If EXPR is omitted, uses
L|perlvar/$_>.
You should not use this function for rounding: one because it truncates
towards C, and two because machine representations of floating-point
numbers can sometimes produce counterintuitive results. For example,
C produces -268 rather than the correct -269; that's
because it's really more like -268.99999999999994315658 instead. Usually,
the L|/sprintf FORMAT, LIST>,
L|/printf FILEHANDLE FORMAT, LIST>, or the
L|POSIX/C> and L|POSIX/C>
functions will serve you better than will L|/int EXPR>.
Moreover, C produces Inf (see
L
for explanation), but so do all the alternative methods mentioned above.
=back