Rev 4872 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. |
2 | * |
||
3 | * Permission to use, copy, modify, and distribute this software |
||
4 | * is freely granted, provided that this notice is preserved. |
||
5 | */ |
||
6 | |||
7 | #include "fdlibm.h" |
||
8 | |||
9 | #ifdef __STDC__ |
||
10 | float fmaf(float x, float y, float z) |
||
11 | #else |
||
12 | float fmaf(x,y,z) |
||
13 | float x; |
||
14 | float y; |
||
15 | float z; |
||
16 | #endif |
||
17 | { |
||
18 | /* NOTE: The floating-point exception behavior of this is not as |
||
19 | * required. But since the basic function is not really done properly, |
||
20 | * it is not worth bothering to get the exceptions right, either. */ |
||
21 | /* Let the implementation handle this. */ /* <= NONSENSE! */ |
||
22 | /* In floating-point implementations in which double is larger than float, |
||
23 | * computing as double should provide the desired function. Otherwise, |
||
24 | * the behavior will not be as specified in the standards. */ |
||
25 | return (float) (((double) x * (double) y) + (double) z); |
||
26 | } |
||
27 | |||
28 | #ifdef _DOUBLE_IS_32BITS |
||
29 | |||
30 | #ifdef __STDC__ |
||
31 | double fma(double x, double y, double z) |
||
32 | #else |
||
33 | double fma(x,y,z) |
||
34 | double x; |
||
35 | double y; |
||
36 | double z; |
||
37 | #endif |
||
38 | { |
||
39 | return (double) fmaf((float) x, (float) y, (float) z); |
||
40 | } |
||
41 | |||
42 | #endif /* defined(_DOUBLE_IS_32BITS) */=> |