version 1.3, 2000/08/21 08:31:28 |
version 1.5, 2000/11/15 02:16:30 |
|
|
* shall be made on your publication or presentation in any form of the |
* shall be made on your publication or presentation in any form of the |
* results obtained by use of the SOFTWARE. |
* results obtained by use of the SOFTWARE. |
* (4) In the event that you modify the SOFTWARE, you shall notify FLL by |
* (4) In the event that you modify the SOFTWARE, you shall notify FLL by |
* e-mail at risa-admin@flab.fujitsu.co.jp of the detailed specification |
* e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification |
* for such modification or the source code of the modified part of the |
* for such modification or the source code of the modified part of the |
* SOFTWARE. |
* SOFTWARE. |
* |
* |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/engine/real.c,v 1.2 2000/02/04 09:27:31 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/engine/real.c,v 1.4 2000/08/22 05:04:06 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "base.h" |
#include "base.h" |
|
|
*c = 0; |
*c = 0; |
else { |
else { |
t = ToReal(a)*ToReal(b); |
t = ToReal(a)*ToReal(b); |
|
#if 0 |
if ( !t ) |
if ( !t ) |
error("mulreal : Underflow"); /* XXX */ |
error("mulreal : Underflow"); /* XXX */ |
else |
else |
|
#endif |
MKReal(t,*c); |
MKReal(t,*c); |
} |
} |
} |
} |
|
|
*c = 0; |
*c = 0; |
else { |
else { |
t = ToReal(a)/ToReal(b); |
t = ToReal(a)/ToReal(b); |
|
#if 0 |
if ( !t ) |
if ( !t ) |
error("divreal : Underflow"); /* XXX */ |
error("divreal : Underflow"); /* XXX */ |
else |
else |
|
#endif |
MKReal(t,*c); |
MKReal(t,*c); |
} |
} |
} |
} |
|
|
*c = 0; |
*c = 0; |
else if ( !RATN(b) || !INT(b) || (PL(NM((Q)b)) > 1) ) { |
else if ( !RATN(b) || !INT(b) || (PL(NM((Q)b)) > 1) ) { |
t = (double)pow((double)ToReal(a),(double)ToReal(b)); |
t = (double)pow((double)ToReal(a),(double)ToReal(b)); |
|
#if 0 |
if ( !t ) |
if ( !t ) |
error("pwrreal : Underflow"); /* XXX */ |
error("pwrreal : Underflow"); /* XXX */ |
else |
else |
|
#endif |
MKReal(t,*c); |
MKReal(t,*c); |
} else { |
} else { |
t = pwrreal0(BDY((Real)a),BD(NM((Q)b))[0]); |
t = pwrreal0(BDY((Real)a),BD(NM((Q)b))[0]); |
t = SGN((Q)b)>0?t:1/t; |
t = SGN((Q)b)>0?t:1/t; |
|
#if 0 |
if ( !t ) |
if ( !t ) |
error("pwrreal : Underflow"); /* XXX */ |
error("pwrreal : Underflow"); /* XXX */ |
else |
else |
|
#endif |
MKReal(t,*c); |
MKReal(t,*c); |
} |
} |
} |
} |