Share via


BigDecimal.Subtract Method

Definition

Overloads

Subtract(BigDecimal, MathContext)

Returns a BigDecimal whose value is (this - subtrahend), with rounding according to the context settings.

Subtract(BigDecimal)

Returns a BigDecimal whose value is (this - subtrahend), and whose scale is max(this.scale(), subtrahend.scale()).

Subtract(BigDecimal, MathContext)

Returns a BigDecimal whose value is (this - subtrahend), with rounding according to the context settings.

[Android.Runtime.Register("subtract", "(Ljava/math/BigDecimal;Ljava/math/MathContext;)Ljava/math/BigDecimal;", "GetSubtract_Ljava_math_BigDecimal_Ljava_math_MathContext_Handler")]
public virtual Java.Math.BigDecimal? Subtract (Java.Math.BigDecimal? subtrahend, Java.Math.MathContext? mc);
[<Android.Runtime.Register("subtract", "(Ljava/math/BigDecimal;Ljava/math/MathContext;)Ljava/math/BigDecimal;", "GetSubtract_Ljava_math_BigDecimal_Ljava_math_MathContext_Handler")>]
abstract member Subtract : Java.Math.BigDecimal * Java.Math.MathContext -> Java.Math.BigDecimal
override this.Subtract : Java.Math.BigDecimal * Java.Math.MathContext -> Java.Math.BigDecimal

Parameters

subtrahend
BigDecimal

value to be subtracted from this BigDecimal.

mc
MathContext

the context to use.

Returns

this - subtrahend, rounded as necessary.

Attributes

Exceptions

if subtrahend == null or mc == null.

Remarks

Java documentation for java.math.BigDecimal.subtract(java.math.BigDecimal, java.math.MathContext).

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

Subtract(BigDecimal)

Returns a BigDecimal whose value is (this - subtrahend), and whose scale is max(this.scale(), subtrahend.scale()).

[Android.Runtime.Register("subtract", "(Ljava/math/BigDecimal;)Ljava/math/BigDecimal;", "GetSubtract_Ljava_math_BigDecimal_Handler")]
public virtual Java.Math.BigDecimal? Subtract (Java.Math.BigDecimal? subtrahend);
[<Android.Runtime.Register("subtract", "(Ljava/math/BigDecimal;)Ljava/math/BigDecimal;", "GetSubtract_Ljava_math_BigDecimal_Handler")>]
abstract member Subtract : Java.Math.BigDecimal -> Java.Math.BigDecimal
override this.Subtract : Java.Math.BigDecimal -> Java.Math.BigDecimal

Parameters

subtrahend
BigDecimal

value to be subtracted from this BigDecimal.

Returns

this - subtrahend

Attributes

Exceptions

if subtrahend == null.

Remarks

Java documentation for java.math.BigDecimal.subtract(java.math.BigDecimal).

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