|
A decimal floating-point constant specifies a decimal floating-point number as two numbers separated by an E.
The first number can include a sign and a decimal point.
The second number can include a sign but not a decimal point.
Uma constante de ponto flutuante decimal especifica um número de ponto flutuante decimal como dois números separados por um E.
O primeiro número pode incluir um sinal e um ponto decimal.
O segundo número pode incluir um sinal, mas não um ponto decimal.
The value of the constant is the product of the first number and the power of 10 specified by the second number.
The value must be within the range of DECFLOAT(34).
The number of characters in the constant must not exceed 42.
Excluding leading zeros, the number of digits in the first number must not exceed 34 and the number of digits in the second number must not exceed 4.
O valor da constante é o produto do primeiro número e a potência de 10 especificada pelo segundo número.
O valor deve estar dentro da faixa de DECFLOAT (34). O número de caracteres na constante não deve exceder 42.
Excluindo os zeros à esquerda, o número de dígitos no primeiro número não deve exceder 34 e o número de dígitos no segundo número não deve exceder 4.
A constant that is specified as two numbers separated by an E is a decimal-floating point constant only is the value is outside the range of a floating-point
constant.
A constant that is specified as a number that does not contain an E, and has more than 31 digits, is also a decimal-floating point constant.
Uma constante especificada como dois números separados por um E é uma constante de vírgula flutuante decimal apenas se o valor estiver fora
do intervalo de uma constante de vírgula flutuante.
Uma constante especificada como um número que não contém um E e tem mais de 31 dígitos também é uma constante de ponto flutuante decimal.
In addition to numeric constants, the following special values can be used to specify decimal-floating point special values:
- INF or INFINITY - represents infinity
- NAN - represents quiet not-a-number
- SNAN - represents signaling not-a-number
Além das constantes numéricas, os seguintes valores especiais podem ser usados para especificar valores especiais de vírgula flutuante decimal:
- INF ou INFINITY - representa infinito
- NAN - representa não-um-número silencioso
- SNAN - representa a sinalização não-um-número
The special values can be any combination of uppercase or lowercase letters and can be preceded by an operational sign (+ or -).
Os valores especiais podem ser qualquer combinação de letras maiúsculas ou minúsculas e podem ser precedidos por um sinal operacional (+ ou -).
SNAN results in a warning or exception when it is used in a numerical operation; NAN does not.
SNAN can be used in non-numerical operations without causing a warning or exception.
For example, SNAN can be used in the VALUES list of an insert operation or as a constant used in a comparison in a predicate.
SNAN resulta em um aviso ou exceção quando é usado em uma operação numérica; NAN não.
SNAN pode ser usado em operações não numéricas sem causar um aviso ou exceção.
Por exemplo, SNAN pode ser usado na lista VALUES de uma operação de inserção ou como uma constante usada em uma comparação em um predicado.
When the special values are used in a predicate, the following order of precedence applies:
Quando os valores especiais são usados ??em um predicado, a seguinte ordem de precedência se aplica:
-NAN < -SNAN < -INFINITY < -0 < 0 < INFINITY < SNAN < NAN
Examples: The following decimal floating-point constants represent the numbers 123456789012345678, sNaN, and negative infinity:
Exemplos: as seguintes constantes de ponto flutuante decimal representam os números 123456789012345678, sNaN e infinito negativo:
123456789012345678E0 SNAN -INFINITY
When one of the special values is used in a context where it could be interpreted as an identifier, such as a column name, cast a string constant that represents
the special value to decimal-floating point.
Quando um dos valores especiais é usado em um contexto onde pode ser interpretado como um identificador, como um nome de coluna, converta uma
constante de string que representa o valor especial em ponto flutuante decimal.
CAST ('snan' AS DECFLOAT)
CAST ('INF' AS DECFLOAT)
CAST ('Nan' AS DECFLOAT)
Parent topic: Constants
© Copyright IBM Corp.
|