다음을 통해 공유


StrictMath.CopySign Method

Definition

Overloads

CopySign(Double, Double)

Returns the first floating-point argument with the sign of the second floating-point argument.

CopySign(Single, Single)

Returns the first floating-point argument with the sign of the second floating-point argument.

CopySign(Double, Double)

Returns the first floating-point argument with the sign of the second floating-point argument.

[Android.Runtime.Register("copySign", "(DD)D", "")]
public static double CopySign (double magnitude, double sign);
[<Android.Runtime.Register("copySign", "(DD)D", "")>]
static member CopySign : double * double -> double

Parameters

magnitude
Double

the parameter providing the magnitude of the result

sign
Double

the parameter providing the sign of the result

Returns

a value with the magnitude of magnitude and the sign of sign.

Attributes

Remarks

Returns the first floating-point argument with the sign of the second floating-point argument. For this method, a NaN sign argument is always treated as if it were positive.

Added in 1.6.

Java documentation for java.lang.StrictMath.copySign(double, double).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

CopySign(Single, Single)

Returns the first floating-point argument with the sign of the second floating-point argument.

[Android.Runtime.Register("copySign", "(FF)F", "")]
public static float CopySign (float magnitude, float sign);
[<Android.Runtime.Register("copySign", "(FF)F", "")>]
static member CopySign : single * single -> single

Parameters

magnitude
Single

the parameter providing the magnitude of the result

sign
Single

the parameter providing the sign of the result

Returns

a value with the magnitude of magnitude and the sign of sign.

Attributes

Remarks

Returns the first floating-point argument with the sign of the second floating-point argument. For this method, a NaN sign argument is always treated as if it were positive.

Added in 1.6.

Java documentation for java.lang.StrictMath.copySign(float, float).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to