When IV-precision is less than NV-precision, there can be values for which the "%" operator behaves in a way that does not conform with my understanding of the perlop documentation.
Steps to Reproduce
On a perl-5.34.0, whose ivsize is 8 and whose nvtype is __float128 I get:
I believe that the relevant pieces of perlop documentation regarding the behaviour of the % operator for these given values of $m and $n are:
If $n is positive, then "$m % $n" is $m minus the largest multiple of $n less than or equal to $m.
....
If the operands $m and $n are floating point values and the absolute value of $n (that is "abs($n)")
is less than "(UV_MAX + 1)", only the integer portion of $m and $n will be used in the operation
(Note: here "UV_MAX" means the maximum of the unsigned integer type)
To me that documentation implies that the correct result for the given example is given by:
Description
When IV-precision is less than NV-precision, there can be values for which the "%" operator behaves in a way that does not conform with my understanding of the perlop documentation.
Steps to Reproduce
On a perl-5.34.0, whose ivsize is 8 and whose nvtype is __float128 I get:
The POSIX module disagrees:
Expected behavior
I believe that the relevant pieces of perlop documentation regarding the behaviour of the % operator for these given values of $m and $n are:
To me that documentation implies that the correct result for the given example is given by:
Similar behaviour exists when ivsize is 4, and nvtype is __float128:
And also when ivsize is 4 and nvtype is long double:
Oddly, however, all works as documented when ivsize is 4 and nvtype is double:
Perl configuration