sign - HLSL
Microsoft DirectX 9.0 SDK Update (October 2004)

sign - HLSL


Computes the sign of x. Returns -1 if x is less than 0, 0 if x equals 0, and 1 if x is greater than zero.

Syntax

ret sign(x)

Where:

NameIn/OutTemplate TypeComponent TypeSize
xinscalar, vector, or matrixfloat, intany
retoutsame as input xintsame dimension(s) as input x

Minimum Shader Version

This intrinsic function is supported in the following (or above) shader versions:

Vertex ShaderPixel Shader
vs_1_1ps_1_4


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.