Name
isfinite - test whether or not a scalar or each vector component
is a finite value
Synopsis
bool isfinite(float x);
bool1 isfinite(float1 x);
bool2 isfinite(float2 x);
bool3 isfinite(float3 x);
bool4 isfinite(float4 x);
bool isfinite(half x);
bool1 isfinite(half1 x);
bool2 isfinite(half2 x);
bool3 isfinite(half3 x);
bool4 isfinite(half4 x);
bool isfinite(fixed x);
bool1 isfinite(fixed1 x);
bool2 isfinite(fixed2 x);
bool3 isfinite(fixed3 x);
bool4 isfinite(fixed4 x);
Parameters
- x
-
Vector or scalar to test for finiteness.
Description
Returns whether or not a scalar or each vector component is a finite
value. Infinity and not-a-number (NaN) values are not finite.
Reference Implementation
isfinite for float3 vectors could be implemented like this.
bool3 isfinite(float3 s)
{
// By IEEE 754 rule, 2*Inf equals Inf
return (s == s) && ((s == 0) || (s != 2*s));
}
Profile Support
isfinite is supported in all profiles except fp20.
See Also
isinf, isnan
|