Share via


Decimal19 Type ("M" Reference)

[This content is no longer valid. For the latest information on "M", "Quadrant", SQL Server Modeling Services, and the Repository, see the Model Citizen blog.]

The Decimal19 type encompasses all fixed point or exact numbers with fewer than 20 digits of precision.

Operators

The unary operations in the following table take Decimal19 as a right operand.

Operator Return

+, -

Decimal19

The binary operations in the following table take Decimal19 as a left operand.

Operator Right Operand Return

+, -

Decimal

Decimal

*, /, %

Decimal

Decimal

>, <, <=, >=, ==, !=

Decimal

Logical

The arithmetic operations (+, -, *, /, %) are specialized to return the most specific type of its operands. For example, Decimal9 + Decimal9 returns Decimal9, while Decimal9 + Decimal38 returns Decimal38).

Remarks

The following operations may cause underflow and overflow errors:

  • The predefined unary - operator.

  • The predefined +, -, *, and / binary operators.

  • Explicit numeric conversions from one Number type to another.

If all of the operands are constant expressions, underflow and overflow is a compile error; otherwise, underflow and overflow is a runtime error.

The following operations may cause a divide by zero error:

  • The predefined / and % binary operators.

If the second operand (the denominator) is a constant expression, divide by zero is a compile error; otherwise, divide by zero is a runtime error.

Code Example

The following code shows the Millimeters field being declared as a Decimal19 type and receiving the value of 43.1.

Millimeters : Decimal19 = 43.1;