cds-astro / cds-healpix-rust

The CDS HEALPix library in Rust (WebAssembly, Python, ...)
Apache License 2.0
16 stars 5 forks source link

Fix libpsql regression test for Postgres 12+ #4

Closed gmantele closed 1 year ago

gmantele commented 1 year ago

Among the regression tests for the Postgres extension of cds-healpix-rust (called "pg_cds_healpix"), there is one test whose result precision is different since version 12 included.

Until Postgres 11:

SELECT hpx_center(15, 10737418240);
       hpx_center
--------------------------
 {225,-89.9985723325173}

But from Postgres 12 (until 15 included):

SELECT hpx_center(15, 10737418240);
        hpx_center
--------------------------
 {225,-89.99857233251726}

This Pull Request fixes this issue by rounding the declination to 13 decimals (i.e. number of decimals returned in Postgres 10 and 11), only when checking test result.