version 1.25, 2004/08/22 12:52:34 |
version 1.27, 2004/08/28 07:28:54 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport0.c,v 1.24 2004/08/22 02:00:24 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/kanExport0.c,v 1.26 2004/08/23 08:33:55 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include "datatype.h" |
#include "datatype.h" |
#include "stackm.h" |
#include "stackm.h" |
Line 797 struct object KooGreater(obj1,obj2) |
|
Line 797 struct object KooGreater(obj1,obj2) |
|
if ( KopDouble(obj1) > KopDouble(obj2) ) return(KpoInteger(1)); |
if ( KopDouble(obj1) > KopDouble(obj2) ) return(KpoInteger(1)); |
else return(KpoInteger(0)); |
else return(KpoInteger(0)); |
break; |
break; |
|
case Sarray: |
|
{ |
|
int i,m1,m2; |
|
struct object rr; |
|
m1 = getoaSize(obj1); m2 = getoaSize(obj2); |
|
for (i=0; i< (m1>m2?m2:m1); i++) { |
|
rr=KooGreater(getoa(obj1,i),getoa(obj2,i)); |
|
if (KopInteger(rr) == 1) return rr; |
|
rr=KooGreater(getoa(obj2,i),getoa(obj1,i)); |
|
if (KopInteger(rr) == 1) return KpoInteger(0); |
|
} |
|
if (m1 > m2) return KpoInteger(1); |
|
else return KpoInteger(0); |
|
} |
|
break; |
default: |
default: |
errorKan1("%s\n","KooGreater() has not supported these objects yet."); |
errorKan1("%s\n","KooGreater() has not supported these objects yet."); |
break; |
break; |
Line 838 struct object KooLess(obj1,obj2) |
|
Line 853 struct object KooLess(obj1,obj2) |
|
if ( KopDouble(obj1) < KopDouble(obj2) ) return(KpoInteger(1)); |
if ( KopDouble(obj1) < KopDouble(obj2) ) return(KpoInteger(1)); |
else return(KpoInteger(0)); |
else return(KpoInteger(0)); |
break; |
break; |
|
case Sarray: |
|
{ |
|
int i,m1,m2; |
|
struct object rr; |
|
m1 = getoaSize(obj1); m2 = getoaSize(obj2); |
|
for (i=0; i< (m1>m2?m2:m1); i++) { |
|
rr=KooLess(getoa(obj1,i),getoa(obj2,i)); |
|
if (KopInteger(rr) == 1) return rr; |
|
rr=KooLess(getoa(obj2,i),getoa(obj1,i)); |
|
if (KopInteger(rr) == 1) return KpoInteger(0); |
|
} |
|
if (m1 < m2) return KpoInteger(1); |
|
else return KpoInteger(0); |
|
} |
|
break; |
default: |
default: |
errorKan1("%s\n","KooLess() has not supported these objects yet."); |
errorKan1("%s\n","KooLess() has not supported these objects yet."); |
break; |
break; |
Line 1084 struct object KdataConversion(obj,key) |
|
Line 1114 struct object KdataConversion(obj,key) |
|
break; |
break; |
case SuniversalNumber: |
case SuniversalNumber: |
if ((strcmp(key,"universalNumber")==0) || (strcmp(key,"numerator")==0)) { |
if ((strcmp(key,"universalNumber")==0) || (strcmp(key,"numerator")==0)) { |
|
rob = obj; |
return(rob); |
return(rob); |
}else if (strcmp(key,"integer")==0) { |
}else if (strcmp(key,"integer")==0) { |
rob = KpoInteger(coeffToInt(obj.lc.universalNumber)); |
rob = KpoInteger(coeffToInt(obj.lc.universalNumber)); |