Name

isinf - test whether or not a scalar or each vector component is infinite

Synopsis

bool  isinf(float x);
bool1 isinf(float1 x);
bool2 isinf(float2 x);
bool3 isinf(float3 x);
bool4 isinf(float4 x);

bool   isinf(half x);
bool1  isinf(half1 x);
bool2  isinf(half2 x);
bool3  isinf(half3 x);
bool4  isinf(half4 x);

bool  isinf(fixed x);
bool1 isinf(fixed1 x);
bool2 isinf(fixed2 x);
bool3 isinf(fixed3 x);
bool4 isinf(fixed4 x);

Parameters

x
Vector or scalar to test if infinite.

Description

Returns whether or not a scalar or each vector component is a (negative or positive) infinite value. Finite and not-a-number (NaN) values are not infinite.

Reference Implementation

isinf for float3 vectors could be implemented like this.

bool3 isinf(float3 s)
{
  // By IEEE 754 rule, 2*Inf equals Inf
  return (2*s == s) && (s != 0);
}

Profile Support

isinf is supported in all profiles except fp20.

See Also

isfinite, isnan