Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Use decimal directive

The use decimal directive is used to provide a DecimalContext instance at the surrounding frame for configuring the decimal data type.

const ctx = new DecimalContext("half_even") // round to even

{
    use decimal ctx
    x = a + b // "+" rounds to even if necessary
}

Syntax

    UseDecimalDirective :
      use decimal ListExpressionallowIn