Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

math.chgsign

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static float chgsign(float x, float y);

Parameters

Parameter Description
x The single precision float to change the sign.
y The single precision float used to test the most significant bit.

Returns

float Returns x with changed sign based on y.

Description

Change the sign of x based on the most significant bit of y [msb(y) ? -x : x].


Declaration

public static float2 chgsign(float2 x, float2 y);

Parameters

Parameter Description
x The single precision float vector to change the sign.
y The single precision float vector used to test the most significant bit.

Returns

float2 Returns vector x with changed sign based on vector y.

Description

Change the sign of components of x based on the most significant bit of components of y [msb(y) ? -x : x].


Declaration

public static float3 chgsign(float3 x, float3 y);

Parameters

Parameter Description
x The single precision float vector to change the sign.
y The single precision float vector used to test the most significant bit.

Returns

float3 Returns vector x with changed sign based on vector y.

Description

Change the sign of components of x based on the most significant bit of components of y [msb(y) ? -x : x].


Declaration

public static float4 chgsign(float4 x, float4 y);

Parameters

Parameter Description
x The single precision float vector to change the sign.
y The single precision float vector used to test the most significant bit.

Returns

float4 Returns vector x with changed sign based on vector y.

Description

Change the sign of components of x based on the most significant bit of components of y [msb(y) ? -x : x].