=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/include/b.h,v retrieving revision 1.2 retrieving revision 1.5 diff -u -p -r1.2 -r1.5 --- OpenXM_contrib2/asir2000/include/b.h 2000/08/21 08:31:36 1.2 +++ OpenXM_contrib2/asir2000/include/b.h 2005/07/11 10:14:09 1.5 @@ -23,7 +23,7 @@ * shall be made on your publication or presentation in any form of the * results obtained by use of the SOFTWARE. * (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 * SOFTWARE. * @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/include/b.h,v 1.1.1.1 1999/12/03 07:39:11 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/include/b.h,v 1.4 2005/07/03 10:19:23 ohara Exp $ */ #ifdef FBASE #define D_ADDP(x,y,z,u) addp(x,y,z,u) @@ -80,10 +80,12 @@ #define MULNUM(x,y,z) (*mulnumt[MAX(NID((Q)x),NID((Q)y))])(x,y,z) #define DIVNUM(x,y,z) (*divnumt[MAX(NID((Q)x),NID((Q)y))])(x,y,z) #define PWRNUM(x,y,z) (*pwrnumt[NID((Q)x)])(x,y,z) -#define CHSGNNUM(x,y) \ -(NID((Q)x)==N_Q?(DUPQ((Q)x,(Q)y),SGN((Q)y)= -SGN((Q)y),(y))\ - :NID((Q)x)==N_R?(NEWReal((Real)y),BDY((Real)y)= -BDY((Real)x),(y))\ - :((*chsgnnumt[NID((Q)x)])(x,&y),(y))) +#define CHSGNNUM(x,y) { \ + if (NID((Q)x)==N_Q) { \ + Q t__; DUPQ((Q)(x),t__); SGN((Q)t__)= -SGN(t__); (y)= t__; } \ + else if (NID((Q)x)==N_R) { \ + Real t__; NEWReal(t__); BDY(t__)= -BDY((Real)x); (y) = t__; } \ + else {P t__; (*chsgnnumt[NID((Q)x)])(x,&t__); (y) = t__; } } #define ADDQ(x,y,z) addq(x,y,z) #define SUBQ(x,y,z) subq(x,y,z) #define MULQ(x,y,z) mulq(x,y,z) @@ -134,7 +136,7 @@ #define MULNUM(x,y,z) mulmq(mod,(MQ)x,(MQ)y,(MQ *)z) #define DIVNUM(x,y,z) divmq(mod,(MQ)x,(MQ)y,(MQ *)z) #define PWRNUM(x,y,z) pwrmq(mod,(MQ)x,y,(MQ *)z) -#define CHSGNNUM(x,y) (NEWMQ((MQ)y),CONT((MQ)(y))=mod-CONT((MQ)(x))) +#define CHSGNNUM(x,y) {MQ t__; NEWMQ(t__),CONT(t__)=mod-CONT((MQ)(x)); (y)=t__; } #define ADDQ(x,y,z) addmq(mod,x,y,z) #define SUBQ(x,y,z) submq(mod,x,y,z) #define MULQ(x,y,z) mulmq(mod,x,y,z)