floatr(x)

Returns 1.0/x converted to a 32 bit IEEE floating point value. Higher precision than floatv(1/x) when x is a large number.

Parameters:

x - any var.

Return:

1/x converted to a 32 bit IEEE floating point value, but still with type var

Speed:

F ast

Remarks:

In lite-C a var is automatically converted when assigned to a float variable, but this function is still useful if a var variable is to be interpreted as a float (as in matrix skills used for shaders).

Example:

mtl_bump.skill2 = floatr(camera.fog_end - camera.fog_start); // pass 1.0/(fog_end-fog_start) to a vertex shader

See also:

floatv, floatd, fixed