PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ test_f2d()

static void test_f2d ( void  )
static

Definition at line 667 of file cu_libgeom.c.

References next_float_down(), and next_float_up().

Referenced by libgeom_suite_setup().

668 {
669  double d = 1000000.123456789123456789;
670  float f;
671  double e;
672 
673  f = next_float_down(d);
674  d = next_float_down(f);
675  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
676 
677  e = (double)f;
678  CU_ASSERT_DOUBLE_EQUAL(f,e, 0.0000001);
679 
680  f = next_float_down(d);
681  d = next_float_down(f);
682  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
683 
684  f = next_float_up(d);
685  d = next_float_up(f);
686  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
687 
688  f = next_float_up(d);
689  d = next_float_up(f);
690  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
691 }
float next_float_down(double d)
Definition: lwgeom_api.c:52
float next_float_up(double d)
Definition: lwgeom_api.c:68
Here is the call graph for this function:
Here is the caller graph for this function: