Add assign operator for floats to allow implicit int-to-float conversion (bug 3997, r=dvander)
Former-commit-id: 04b6a21f239bb9332a1410d22c8c3c45510a28b2
This commit is contained in:
parent
6139d52a39
commit
d9fb9bac09
@ -173,10 +173,14 @@ stock bool:operator<=(oper1, Float:oper2)
|
|||||||
stock bool:operator!(Float:oper)
|
stock bool:operator!(Float:oper)
|
||||||
return (_:oper & ((-1)/2)) == 0; /* -1 = all bits to 1; /2 = remove most significant bit (sign)
|
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 */
|
works on both 32bit and 64bit systems; no constant required */
|
||||||
|
stock Float:operator=(oper)
|
||||||
|
return float(oper);
|
||||||
|
|
||||||
/* forbidden operations */
|
/* forbidden operations */
|
||||||
forward operator%(Float:oper1, Float:oper2);
|
forward operator%(Float:oper1, Float:oper2);
|
||||||
forward operator%(Float:oper1, oper2);
|
forward operator%(Float:oper1, oper2);
|
||||||
forward operator%(oper1, Float:oper2);
|
forward operator%(oper1, Float:oper2);
|
||||||
|
forward operator=(Float:oper);
|
||||||
|
|
||||||
|
|
||||||
stock Float:floatmin(Float:ValueA, Float:ValueB)
|
stock Float:floatmin(Float:ValueA, Float:ValueB)
|
||||||
|
Loading…
Reference in New Issue
Block a user