[Libre-soc-bugs] [Bug 676] FORTRAN MAXLOC SVP64 example

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Nov 16 22:21:12 GMT 2023


https://bugs.libre-soc.org/show_bug.cgi?id=676

--- Comment #21 from Jacob Lifshay <programmerjake at gmail.com> ---
i noticed that changing the initial value of m to 0 instead of INT_MIN is
incorrect, since the algorithm uses signed integers. m starting at 0 (or
actually any int at all) is incorrect since the algorithm ignores all array
elements <= m, thereby giving the wrong answer for input [-5, -7, -6] or even
[-1, 0, -2] -- both of those return -1 even though the correct answer is 0 and
1 respectively.

https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=maxloc/maxloc.c;h=6becf3ef26fb8f71e50dbd0bcb774c6d49d307c2;hb=f9d2e36493632a179e08f5eb3569b1f9f05d05d1

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list