PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ test_f2d()

static void test_f2d ( void  )
static

Definition at line 647 of file cu_gserialized1.c.

648 {
649  double d = 1000000.123456789123456789;
650  float f;
651  double e;
652 
653  f = next_float_down(d);
654  d = next_float_down(f);
655  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
656 
657  e = (double)f;
658  CU_ASSERT_DOUBLE_EQUAL(f,e, 0.0000001);
659 
660  f = next_float_down(d);
661  d = next_float_down(f);
662  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
663 
664  f = next_float_up(d);
665  d = next_float_up(f);
666  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
667 
668  f = next_float_up(d);
669  d = next_float_up(f);
670  CU_ASSERT_DOUBLE_EQUAL(f,d, 0.0000001);
671 
672  d = DBL_MAX;
673  f = next_float_up(d);
674  d = next_float_up(f);
675  CU_ASSERT_DOUBLE_EQUAL(f, d, 0.0000001);
676 
677  d = DBL_MAX;
678  f = next_float_down(d);
679  d = next_float_down(f);
680  CU_ASSERT_DOUBLE_EQUAL(f, d, 0.0000001);
681 
682  d = -DBL_MAX;
683  f = next_float_up(d);
684  d = next_float_up(f);
685  CU_ASSERT_DOUBLE_EQUAL(f, d, 0.0000001);
686 
687  d = -DBL_MAX;
688  f = next_float_down(d);
689  d = next_float_down(f);
690  CU_ASSERT_DOUBLE_EQUAL(f, d, 0.0000001);
691 }
float next_float_up(double d)
Definition: lwgeom_api.c:75
float next_float_down(double d)
Definition: lwgeom_api.c:54

References next_float_down(), and next_float_up().

Referenced by gserialized1_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: