diff --git a/lang/basic/lib/exp.c b/lang/basic/lib/exp.c index 4b4a1212f..b9cf5d0cc 100644 --- a/lang/basic/lib/exp.c +++ b/lang/basic/lib/exp.c @@ -17,7 +17,7 @@ floor(x) extern double _fif(); double val; - return _fif(x, 1,0, &val) < 0 ? val - 1.0 : val ; + return _fif(x, 1.0, &val) < 0 ? val - 1.0 : val ; /* this also works if _fif always returns a positive fractional part */ diff --git a/lang/cem/libcc/math/exp.c b/lang/cem/libcc/math/exp.c index 737ae234c..2d52ed5c4 100644 --- a/lang/cem/libcc/math/exp.c +++ b/lang/cem/libcc/math/exp.c @@ -42,7 +42,7 @@ exp(x) return M_MIN_D; } if (x >= M_LN_MAX_D) { - if (x < M_LN_MAX_D) errno = ERANGE; + if (x > M_LN_MAX_D) errno = ERANGE; return M_MAX_D; } diff --git a/lang/pc/libpc/exp.c b/lang/pc/libpc/exp.c index 2fea29932..504b4a13e 100644 --- a/lang/pc/libpc/exp.c +++ b/lang/pc/libpc/exp.c @@ -18,7 +18,7 @@ floor(x) extern double _fif(); double val; - return _fif(x, 1,0, &val) < 0 ? val - 1.0 : val ; + return _fif(x, 1.0, &val) < 0 ? val - 1.0 : val ; /* this also works if _fif always returns a positive fractional part */