Opened 7 years ago

Closed 7 years ago

#3852 closed enhancement (fixed)

float rounding using local hacks

Reported by: pramsey Owned by: pramsey
Priority: medium Milestone: PostGIS 2.4.0
Component: postgis Version: master
Keywords: Cc:

Description

There are actually nice, faster system-level functions for nextafterf() (lwgeom_api.c) so we don't need the hacks in our float rounding from many moons ago.

Change History (2)

comment:1 by pramsey, 7 years ago

I found a regression failure when I ran my fix for this ticket, but the problem appears to be in the *existing* behavior, not mine…

When adding a box to POINT(1e+15 1e+15), aka POINT(1000000000000000 1000000000000000) the regression suite says the result of the ST_BoundingDiagonal should be LINESTRING(999999986991104 999999986991104,999999986991104 999999986991104)

Wait a sec, that box doesn't enclose the original point! Huge fail! My new code does enclose it, with LINESTRING(999999986991104 999999986991104,1.00000005409997e+15 1.00000005409997e+15).

I wouldn't ordinarily commit a fix that changes regression so late in the day, but in this case, it seems an improvement. Hopefully the other platforms agree.

Last edited 7 years ago by pramsey (previous) (diff)

comment:2 by pramsey, 7 years ago

Resolution: fixed
Status: newclosed

In 15772:

Remove the local hacks for float rounding and go
with system level functions, that are hopefully
more optimized. Also, this seems to provide more
correct results than the old code!
(Closes #3852)

Note: See TracTickets for help on using tickets.