projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* as/hc08/clean.mk,
[fw/sdcc]
/
device
/
lib
/
sincoshf.c
diff --git
a/device/lib/sincoshf.c
b/device/lib/sincoshf.c
index 4339ae98cba7099852fc43ec57c679b17b812a75..c4e877b6ade0a344972c2826b5b00c6041211b58 100644
(file)
--- a/
device/lib/sincoshf.c
+++ b/
device/lib/sincoshf.c
@@
-1,6
+1,6
@@
/* sincoshf.c: Computes sinh or cosh of a 32-bit float as outlined in [1]
/* sincoshf.c: Computes sinh or cosh of a 32-bit float as outlined in [1]
- Copyright (C) 2001, 2002 Jesus Calvino-Fraga, jesusc@ieee.org
+ Copyright (C) 2001, 2002 Jesus Calvino-Fraga, jesusc@ieee.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@
-23,6
+23,7
@@
#include <math.h>
#include <errno.h>
#include <math.h>
#include <errno.h>
+#include <stdbool.h>
#define P0 -0.713793159E+1
#define P1 -0.190333999E+0
#define P0 -0.713793159E+1
#define P1 -0.190333999E+0
@@
-36,7
+37,7
@@
#define K2 0.24999308500451499336E+0 /* v**(-2) */
#define K3 0.13830277879601902638E-4 /* v/2-1 */
#define K2 0.24999308500451499336E+0 /* v**(-2) */
#define K3 0.13830277879601902638E-4 /* v/2-1 */
-//WMAX is defined as ln(
XMAX
)-ln(v)+0.69
+//WMAX is defined as ln(
HUGE_VALF
)-ln(v)+0.69
#define WMAX 44.93535952E+0
//WBAR 0.35*(b+1)
#define WBAR 1.05
#define WMAX 44.93535952E+0
//WBAR 0.35*(b+1)
#define WBAR 1.05
@@
-45,8
+46,8
@@
float sincoshf(const float x, const int iscosh)
{
float y, w, z;
float sincoshf(const float x, const int iscosh)
{
float y, w, z;
-
int
sign;
-
+
BOOL
sign;
+
if (x<0.0) { y=-x; sign=1; }
else { y=x; sign=0; }
if (x<0.0) { y=-x; sign=1; }
else { y=x; sign=0; }
@@
-58,7
+59,7
@@
float sincoshf(const float x, const int iscosh)
if (w>WMAX)
{
errno=ERANGE;
if (w>WMAX)
{
errno=ERANGE;
- z=
XMAX
;
+ z=
HUGE_VALF
;
}
else
{
}
else
{