This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
POSIX math: todo for emulating fegetround() with fpgetround().
authorJarkko Hietaniemi <jhi@iki.fi>
Sun, 31 Aug 2014 15:03:48 +0000 (11:03 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 31 Aug 2014 21:53:08 +0000 (17:53 -0400)
ext/POSIX/POSIX.xs

index dbf7867..b250868 100644 (file)
@@ -579,6 +579,8 @@ static int my_fegetround()
   return fegetround();
 #elif defined(FLT_ROUNDS)
   return FLT_ROUNDS;
+  /* XXX emulate using fpgetround() (HAS_FPGETROUND):
+   * FP_RN to nearest, FP_RM down, FP_RP, up, FP_RZ truncate */
 #else
   return -1;
 #endif
@@ -599,6 +601,8 @@ static NV my_rint(NV x)
     return (NV)((IV)(x >= 0.0 ? x + 0.5 : x));
   }
 #else
+  /* XXX emulate using fpsetround() (HAS_FPGETROUND):
+   * FP_RN to nearest, FP_RM down, FP_RP, up, FP_RZ truncate */
   return NV_NAN;
 #endif
 }