id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
31984 Can pynac's calculations of special functions cause std::abs to overflow? Dave Morris "The C++ function `std::abs` can overflow, because the twos-complement binary representation of an integer has a negative number (`-2^k`, where `k + 1` is the number of bits) whose negative requires an additional bit. Some bugs resulting from this are fixed in #31585, but the other occurrences of `std::abs` in the pynac source code should also be examined, to determine whether they are also buggy.
There is one other occurrence of `std::abs` in numeric.cpp, but it seems to be safe, because it is taking the absolute value of a floating-point `double`, not an integer. (Furthermore, this `double` is known to be less than `10^200`.)
I think the remaining occurrences of `std::abs` are all in the file **inifcns_nstdsums.cpp**. (In particular, `std::abs(scale)` appears a few times, where `scale` is an `int` variable.) I think this code is computing the values of special functions that are defined by nested sums. (There is mention of ""G transformation"" and ""Hoelder convolution"".) It would be great if someone who understands this would take a look at the occurrences of `std::abs` in the file. " defect new major sage-9.8 symbolics pynac, overflow, absolute value, special functions N/A #31585