user defined operators
Signature
native Float:operator*(Float:oper1, Float:oper2) = floatmul;
Signature
native Float:operator/(Float:oper1, Float:oper2) = floatdiv;
Signature
native Float:operator+(Float:oper1, Float:oper2) = floatadd;
Signature
native Float:operator-(Float:oper1, Float:oper2) = floatsub;
Signature
stock Float:operator++(Float:oper){ return oper+1.0;}
Signature
stock Float:operator--(Float:oper){ return oper-1.0;}
Signature
stock Float:operator-(Float:oper){ return oper^Float:cellmin; /* IEEE values are sign/magnitude */}
Signature
stock Float:operator*(Float:oper1, oper2){ return floatmul(oper1, float(oper2)); /* "*" is commutative */}
Signature
stock Float:operator/(Float:oper1, oper2){ return floatdiv(oper1, float(oper2));}
Signature
stock Float:operator/(oper1, Float:oper2){ return floatdiv(float(oper1), oper2);}
Signature
stock Float:operator+(Float:oper1, oper2){ return floatadd(oper1, float(oper2)); /* "+" is commutative */}
Signature
stock Float:operator-(Float:oper1, oper2){ return floatsub(oper1, float(oper2));}
Signature
stock Float:operator-(oper1, Float:oper2){ return floatsub(float(oper1), oper2);}
Signature
stock bool:operator==(Float:oper1, Float:oper2){ return floatcmp(oper1, oper2) == 0;}
Signature
stock bool:operator==(Float:oper1, oper2){ return floatcmp(oper1, float(oper2)) == 0; /* "==" is commutative */}
Signature
stock bool:operator!=(Float:oper1, Float:oper2){ return floatcmp(oper1, oper2) != 0;}
Signature
stock bool:operator!=(Float:oper1, oper2){ return floatcmp(oper1, float(oper2)) != 0; /* "==" is commutative */}
Signature
stock bool:operator>(Float:oper1, Float:oper2){ return floatcmp(oper1, oper2) > 0;}
Signature
stock bool:operator>(Float:oper1, oper2){ return floatcmp(oper1, float(oper2)) > 0;}
Signature
stock bool:operator>(oper1, Float:oper2){ return floatcmp(float(oper1), oper2) > 0;}
Signature
stock bool:operator>=(Float:oper1, Float:oper2){ return floatcmp(oper1, oper2) >= 0;}
Signature
stock bool:operator>=(Float:oper1, oper2){ return floatcmp(oper1, float(oper2)) >= 0;}
Signature
stock bool:operator>=(oper1, Float:oper2){ return floatcmp(float(oper1), oper2) >= 0;}
Signature
stock bool:operator<(Float:oper1, Float:oper2){ return floatcmp(oper1, oper2) < 0;}
Signature
stock bool:operator<(Float:oper1, oper2){ return floatcmp(oper1, float(oper2)) < 0;}
Signature
stock bool:operator<(oper1, Float:oper2){ return floatcmp(float(oper1), oper2) < 0;}
Signature
stock bool:operator<=(Float:oper1, Float:oper2){ return floatcmp(oper1, oper2) <= 0;}
Signature
stock bool:operator<=(Float:oper1, oper2){ return floatcmp(oper1, float(oper2)) <= 0;}
Signature
stock bool:operator<=(oper1, Float:oper2){ return floatcmp(float(oper1), oper2) <= 0;}
Signature
stock bool:operator!(Float:oper){ return(_:oper & ((-1)/2)) == 0; // -1 = all bits to 1; /2 = remove most significant bit(sign) // works on both 32bit and 64bit systems; no constant required}