All Products
Search
Document Center

TO_BINARY_DOUBLE

Last Updated: Jun 18, 2021

The TO_BINARY_DOUBLE function returns a 64-bit double-precision floating-point number.

Syntax

TO_BINARY_DOUBLE(expr [, fmt [, 'nlsparam' ] ])

Parameters

Parameter

Description

expr

The string or the numeric data type: NUMBER, BINARY_FLOAT, or BINARY_DOUBLE.

The optional parameters fmt and nlsparam are valid only if expr is a string. They serve the same purpose as the TO_CHAR(number) feature. If expr is BINARY_DOUBLE, the function returns expr.

Return type

A 64-bit double-precision floating-point number is returned. The result of converting a string or NUMBER to BINARY_DOUBLE may be inexact. This is because NUMBER and character types use decimal precision to represent numeric values, but BINARY_DOUBLE uses binary precision. The result of converting BINARY_FLOAT to BINARY_DOUBLE is exact.

Examples

Execute the following statement:

SELECT TO_BINARY_DOUBLE(1222.111) FROM DUAL;

The following query result is returned:

+----------------------------+
| TO_BINARY_DOUBLE(1222.111) |
+----------------------------+
|              1.222111E+003 |
+----------------------------+

You can refer to TO_BINARY_FLOAT and TO_CHAR(number).