Konrad Scherer <kscherer@magma.ca> writes:
> The C function returns the correct result all the time but the sum
> returns the wrong result all the time. It mostly returns 23, but it
> returned 24 once!
Very strange. May we see the full text of the C function, and the
SQL declaration you gave for it?
regards, tom lane