I understand that unrealscript will coerse float values to int if you do something like :
Code: Select all
var int i;
var float f;
f = 5.7;
i = f;
Are there any convenient functions that can force the issue?
Cheers.
Phill.
Code: Select all
var int i;
var float f;
f = 5.7;
i = f;
Code: Select all
fv = 5.7;
return BadParameters("f =" @ fv @ "(int)f =" @ int(fv) @ "(int)-f =" @ int(-fv)
@ "(int)(f + 0.5) =" @ int(fv + 0.5) @ "(int)(-f - 0.5) =" @ int(-fv - 0.5));
Code: Select all
---------------------------
Warning
---------------------------
f = 5.700000 (int)f = 5 (int)-f = -5 (int)(f + 0.5) = 6 (int)(-f - 0.5) = -6
---------------------------
ОК
---------------------------