[haiku-bugs] Re: [Haiku] #7007: Implement missing <math.h> functions

  • From: "korli" <trac@xxxxxxxxxxxx>
  • Date: Tue, 21 Dec 2010 09:42:09 -0000

#7007: Implement missing <math.h> functions
---------------------------+------------------------------
  Reporter:  scottmc       |        Owner:  nobody
      Type:  bug           |       Status:  new
  Priority:  normal        |    Milestone:  R1
 Component:  System/POSIX  |      Version:  R1/Development
Resolution:                |     Keywords:
Blocked By:                |  Has a Patch:  1
  Platform:  All           |     Blocking:
---------------------------+------------------------------

Comment (by korli):

 Thanks.

 For GCC4, one should use the builtins functions provided by the compiler:
 #define isgreater(x, y) __builtin_isgreater ((x),(y))
 #define isgreaterequal(x, y) __builtin_isgreaterequal ((x),(y))
 #define isless(x, y) __builtin_isless ((x),(y))
 #define islessequal(x, y) __builtin_islessequal ((x),(y))
 #define islessgreater(x, y) __builtin_islessgreater ((x),(y))
 #define isunordered(x, y) __builtin_isunordered ((x),(y))

 For GCC2, you should definitely rewrite these definitions, sorry but they
 look like verbatim copies of glibc math.h. I hope you understand this
 point.

 MAXFLOAT should be defined to the max float value FLT_MAX defined by the
 compiler (including float.h might be required).

 Unless fma() calls are indeed fast, FP_FAST_FMA definitions should be
 better zero valued. Please add a TODO comment if this needs to be
 revisited.
 For FP_ILOGB0 and FP_ILOGBNAN, I'd prefer the *_MAX equivalent
 definitions.

 Defining math_errhandling to 3 is a bit fast. Please add a TODO comment if
 this needs to be revisited. Also 3 is actually the (MATH_ERRNO |
 MATH_ERREXCEPT).

 w_lgammal.c, w_gamma_r.c and w_gammaf_r.c are to be added to respective
 arch Jamfiles to be included in the build. gamma* functions seem to be
 deprecated in posix specifications. We might want to only include those
 for GCC2.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/7007#comment:5>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: