PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ test_f2d()

static void test_f2d ( void  )
static

Definition at line 666 of file cu_libgeom.c.

References next_float_down(), and next_float_up().

Referenced by libgeom_suite_setup().

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