PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void test_f2d ( void  )
static

Definition at line 658 of file cu_libgeom.c.

References next_float_down(), and next_float_up().

Referenced by libgeom_suite_setup().

659 {
660  double d = 1000000.123456789123456789;
661  float f;
662  double e;
663 
664  f = next_float_down(d);
665  d = next_float_down(f);
666  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
667 
668  e = (double)f;
669  CU_ASSERT_DOUBLE_EQUAL(f,e, 0.0000001);
670 
671  f = next_float_down(d);
672  d = next_float_down(f);
673  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
674 
675  f = next_float_up(d);
676  d = next_float_up(f);
677  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
678 
679  f = next_float_up(d);
680  d = next_float_up(f);
681  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
682 }
float next_float_down(double d)
Definition: lwgeom_api.c:129
float next_float_up(double d)
Definition: lwgeom_api.c:145

Here is the call graph for this function:

Here is the caller graph for this function: