Changes between Version 1 and Version 2 of Ticket #31984


Ignore:
Timestamp:
Jun 17, 2021, 2:22:39 AM (18 months ago)
Author:
Dave Morris
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31984

    • Property Keywords special functions added
    • Property Summary changed from Pynac should be more careful when it uses std::abs to Can pynac's calculations of special functions cause std::abs to overflow?
  • Ticket #31984 – Description

    v1 v2  
    1 The C++ function `std::abs` can overflow, because the twos-complement binary representation 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.
     1The 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.
    22
    3 (There is one other occurrence of `std::abs` in numeric.cpp, and several in inifcns_nstdsums.cpp.)
     3There 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`.)
     4
     5I 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.