Search Perl pages
Professions, Sciences, Humanities, Business, ...
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...
Conversions, tests, processing, manipulation,...
Integer, Floating point, Matrix, Statistics, Boolean, ...
Algorithms, Memory, Process control, Debugging, ...
Data storage, Integrity, Encryption, Compression, ...
Networks, protocols, Interprocess, Remote, Client Server, ...
Timing, Calendar and Clock, Audio, Video, Printer, Controls...
Management, Filtering, File & Directory access, Viewers, ...
use integer provides integer-only arithmetic, there is no similar ways to provide
rounding or truncation at a certain number of decimal places. For rounding
to a certain number of digits,
printf() is usually the easiest route.
POSIX module (part of the standard perl distribution) implements
floor(), and a number of other mathematical and trigonometric functions. The Math::Complex module (part of the standard perl distribution) defines a number of mathematical functions that can also work on real numbers. Math::Complex not as efficient as
POSIX can't work with complex numbers.
Rounding in financial applications can have serious implications, and the
rounding method used should be specified precisely. In these cases, it
probably pays not to trust whichever system rounding is being used by Perl,
but to instead implement the rounding function you need yourself.