I am new to perl and seeking the lowest value in an @array
. Is there some constant that represents a very large integer number?
I know I could sort the array and take the beginning, but that seems to be a lot of wasted CPU cycles. What is an elegant solution to my problem in Perl?
To answer you the question you actually asked (even though it's not really of use to you):
Largest integer value that can be stored as a signed integer.
say ~0 >> 1;
Largest integer value that can be stored as an unsigned integer.
say ~0;
All integer values from 0 to this number can be stored without loss as a floating point number.
use Config qw( %Config );
say eval($Config{nv_overflows_integers_at});
Note that some larger integers can be stored without loss in a floating point number, but not the one 1 higher than this.