Csaba Nagy <nagy@domeus.de> writes:
> I've looked at the code you mentioned, did some experimenting.
> I still don't understand why the negative case ? What dates would be in that
> range ?
IIRC, our internal representation of timestamps puts time 0 at midnight GMT
1/1/2000. Times before that will be negative.
> In any case, the negative number handling seems not doing the same thing as
> the positive one.
That's what I fixed in the patch I applied on 8 Jan.
> The "rint" implementation on my test box has some inconsistentcies too:
Actually, that behavior of "rounding to nearest even" at an xxx.5
boundary is what is specified by the IEEE float-arithmetic standard.
The numerical-analysis justification for the spec doesn't seem to have
much applicability to datetime calculations, perhaps, but that's what
we're going to get on a lot of platforms.
regards, tom lane