Open WPMGPRoSToTeMa opened 6 years ago
cellmin
and cellmax
? I agree, there's no need for those two arguments.
@OciXCrom cellmin
and cellmax
are for integers, but min_val
and max_val
are floats. I'm talking about this:
Two infinities: +∞ and −∞.
We have to implement IEEE-754+Infinity
and -Infinity
then. Might as well have NaN
then.
Yup, I didn't notice the params are floats.
@rsKliPPy I think:
const Float:Infinity = Float:0x7F800000;
should just work.
We have to make sure all FP operations will work correctly (according to the spec) when operating on Infinity
, -Infinity
and NaN
. Creating constants is just the start.
There is another option. We can add NULL_FLOAT
and change create_cvar
signature to:
native create_cvar(const name[], const string[], flags = FCVAR_NONE, const description[] = "", const &Float:min_val = NULL_FLOAT, const &Float:max_val = NULL_FLOAT);
BUT we need to implement compiler support for passing compile-time constants as const &
.
I think we can remove
has_min
andhas_max
params and replacemin_val
/max_val
default values with-Infinity
and+Infinity
respectively.