1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Produce IEEE compliant output from pow() despite platform deviations

src/cmd/ksh93/features/math.sh:
- Specify ast_float.h within iffehdrs instead of math.h, so that iffe
  will pick up on macro substitutions within libast. This should make
  any future efforts to remedy floating point behavior easier as well.
- Always include ast_float.h within the generated math header file,
  not just on IA64 platforms.

src/cmd/ksh93/tests/arith.sh:
- Test pow(1.0,-Inf) and pow(1.0,NaN) for IEEE compliance as well.
- Test the exponentiation operator (**) in addition, as streval.c,
  which processes the same, calls pow() separately.

src/lib/libast/features/float:
- Test the IEEE compliance of the underlying math library's pow()
  function and substitute macros producing compliant behavior if
  necessary.
This commit is contained in:
Lev Kujawski 2021-02-11 15:25:51 -07:00 committed by Martijn Dekker
parent 0f92d63823
commit d5a94b3722
3 changed files with 25 additions and 2 deletions

View file

@ -29,7 +29,7 @@ esac
command=$0
iffeflags="-n -v"
iffehdrs="math.h"
iffehdrs="ast_float.h"
iffelibs="-lm"
table=/dev/null
@ -136,11 +136,11 @@ case $_hdr_ieeefp in
1) echo "#include <ieeefp.h>" ;;
esac
cat <<!
#include <ast_float.h>
#if defined(__ia64__) && defined(signbit)
# if defined __GNUC__ && __GNUC__ >= 4
# define __signbitl(f) __builtin_signbitl(f)
# else
# include <ast_float.h>
# if _lib_copysignl
# define __signbitl(f) (int)(copysignl(1.0,(f))<0.0)
# endif