StrictMath.Scalb Method

Definition

Overloads

Scalb(Double, Int32)

Returns d &times; 2<sup>scaleFactor</sup> rounded as if performed by a single correctly rounded floating-point multiply.

Scalb(Single, Int32)

Returns f &times; 2<sup>scaleFactor</sup> rounded as if performed by a single correctly rounded floating-point multiply.

Scalb(Double, Int32)

Returns d &times; 2<sup>scaleFactor</sup> rounded as if performed by a single correctly rounded floating-point multiply.

[Android.Runtime.Register("scalb", "(DI)D", "")]
public static double Scalb (double d, int scaleFactor);
[<Android.Runtime.Register("scalb", "(DI)D", "")>]
static member Scalb : double * int -> double

Parameters

d
Double

number to be scaled by a power of two.

scaleFactor
Int32

power of 2 used to scale d

Returns

d &times; 2<sup>scaleFactor</sup>

Attributes

Remarks

Returns d &times; 2<sup>scaleFactor</sup> rounded as if performed by a single correctly rounded floating-point multiply. If the exponent of the result is between Double#MIN_EXPONENT and Double#MAX_EXPONENT, the answer is calculated exactly. If the exponent of the result would be larger than Double.MAX_EXPONENT, an infinity is returned. Note that if the result is subnormal, precision may be lost; that is, when scalb(x, n) is subnormal, scalb(scalb(x, n), -n) may not equal x. When the result is non-NaN, the result has the same sign as d.

Special cases: <ul> <li> If the first argument is NaN, NaN is returned. <li> If the first argument is infinite, then an infinity of the same sign is returned. <li> If the first argument is zero, then a zero of the same sign is returned. </ul>

Added in 1.6.

Java documentation for java.lang.StrictMath.scalb(double, int).

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

Scalb(Single, Int32)

Returns f &times; 2<sup>scaleFactor</sup> rounded as if performed by a single correctly rounded floating-point multiply.

[Android.Runtime.Register("scalb", "(FI)F", "")]
public static float Scalb (float f, int scaleFactor);
[<Android.Runtime.Register("scalb", "(FI)F", "")>]
static member Scalb : single * int -> single

Parameters

f
Single

number to be scaled by a power of two.

scaleFactor
Int32

power of 2 used to scale f

Returns

f &times; 2<sup>scaleFactor</sup>

Attributes

Remarks

Returns f &times; 2<sup>scaleFactor</sup> rounded as if performed by a single correctly rounded floating-point multiply. If the exponent of the result is between Float#MIN_EXPONENT and Float#MAX_EXPONENT, the answer is calculated exactly. If the exponent of the result would be larger than Float.MAX_EXPONENT, an infinity is returned. Note that if the result is subnormal, precision may be lost; that is, when scalb(x, n) is subnormal, scalb(scalb(x, n), -n) may not equal x. When the result is non-NaN, the result has the same sign as f.

Special cases: <ul> <li> If the first argument is NaN, NaN is returned. <li> If the first argument is infinite, then an infinity of the same sign is returned. <li> If the first argument is zero, then a zero of the same sign is returned. </ul>

Added in 1.6.

Java documentation for java.lang.StrictMath.scalb(float, int).

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