FirebirdSQL logo

SET DECFLOAT

Configures DECFLOAT rounding and error behaviour for the current session

Syntax
SET DECFLOAT
  { ROUND <round_mode>
  | TRAPS TO [<trap_opt> [, <trap_opt> ...]] }

<round_mode> ::=
    CEILING | UP | HALF_UP | HALF_EVEN
  | HALF_DOWN | DOWN | FLOOR | REROUND

<trap_opt> ::=
    DIVISON_BY_ZERO | INEXACT | INVALID_OPERATION
  | OVERFLOW | UNDERFLOW

SET DECFLOAT ROUND

SET DECFLOAT ROUND changes the rounding behaviour of operations on DECFLOAT.The default rounding mode is HALF_UP.The initial configuration of a connection can also be specified using the DPB tag isc_dpb_decfloat_round with the desired round_mode as string value.

The valid rounding modes are:

CEILING

towards +infinity

UP

away from 0

HALF_UP

to nearest, if equidistant, then up (default)

HALF_EVEN

to nearest, if equidistant, ensure last digit in the result will be even

HALF_DOWN

to nearest, if equidistant, then down

DOWN

towards 0

FLOOR

towards -infinity

REROUND

up if digit to be rounded is 0 or 5, down in other cases

The current value for the connection can be found using RDB$GET_CONTEXT('SYSTEM', 'DECFLOAT_ROUND').

Execution of [fblangref50-management-session-reset-alter] will revert to the value configured through the DPB, or otherwise the system default.