2021-10-11 19:41:50 +08:00
|
|
|
#include "PikaMath_Operator.h"
|
|
|
|
|
|
|
|
int PikaMath_Operator_AND(PikaObj* self, int flag1, int flag2) {
|
|
|
|
return flag1 && flag2;
|
|
|
|
}
|
|
|
|
int PikaMath_Operator_NOT(PikaObj* self, int flag) {
|
|
|
|
return !flag;
|
|
|
|
}
|
|
|
|
int PikaMath_Operator_OR(PikaObj* self, int flag1, int flag2) {
|
|
|
|
return flag1 || flag2;
|
|
|
|
}
|
2022-09-28 11:23:39 +08:00
|
|
|
int PikaMath_Operator_equalFloat(PikaObj* self, pika_float num1, pika_float num2) {
|
2021-10-11 19:41:50 +08:00
|
|
|
return num1 == num2;
|
|
|
|
}
|
|
|
|
int PikaMath_Operator_equalInt(PikaObj* self, int num1, int num2) {
|
|
|
|
return num1 == num2;
|
|
|
|
}
|
2022-09-28 11:23:39 +08:00
|
|
|
int PikaMath_Operator_graterThanFloat(PikaObj* self, pika_float num1, pika_float num2) {
|
2021-10-11 19:41:50 +08:00
|
|
|
return num1 > num2;
|
|
|
|
}
|
|
|
|
int PikaMath_Operator_graterThanInt(PikaObj* self, int num1, int num2) {
|
|
|
|
return num1 > num2;
|
|
|
|
}
|
2022-09-28 11:23:39 +08:00
|
|
|
int PikaMath_Operator_lessThanFloat(PikaObj* self, pika_float num1, pika_float num2) {
|
2021-10-11 19:41:50 +08:00
|
|
|
return num1 < num2;
|
|
|
|
}
|
|
|
|
int PikaMath_Operator_lessThanInt(PikaObj* self, int num1, int num2) {
|
|
|
|
return num1 < num2;
|
|
|
|
}
|
2022-09-28 11:23:39 +08:00
|
|
|
pika_float PikaMath_Operator_minusFloat(PikaObj* self, pika_float num1, pika_float num2) {
|
2021-10-11 19:41:50 +08:00
|
|
|
return num1 - num2;
|
|
|
|
}
|
|
|
|
int PikaMath_Operator_minusInt(PikaObj* self, int num1, int num2) {
|
|
|
|
return num1 - num2;
|
|
|
|
}
|
2022-05-25 13:46:48 +08:00
|
|
|
|
2022-09-28 11:23:39 +08:00
|
|
|
pika_float PikaMath_Operator_plusFloat(PikaObj* self, pika_float num1, pika_float num2) {
|
2021-10-11 19:41:50 +08:00
|
|
|
return num1 + num2;
|
|
|
|
}
|
2022-05-25 13:46:48 +08:00
|
|
|
|
2021-10-11 19:41:50 +08:00
|
|
|
int PikaMath_Operator_plusInt(PikaObj* self, int num1, int num2) {
|
|
|
|
return num1 + num2;
|
2022-05-25 13:46:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
char* PikaMath_Operator___str__(PikaObj *self){
|
|
|
|
obj_setStr(self, "__buf", "test");
|
|
|
|
return obj_getStr(self, "__buf");
|
|
|
|
}
|
2022-06-12 10:44:32 +08:00
|
|
|
|
|
|
|
void PikaMath_Operator___del__(PikaObj *self){
|
|
|
|
__platform_printf("del operator...\r\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
|