Oracle Tutorial

  • Home
  • Start Here
  • Basics
  • Advanced
    • Oracle View
    • Oracle Index
    • Oracle Synonym
    • Oracle Sequence
    • Oracle Administration
  • PL/SQL
  • Functions
    • Aggregate Functions
    • Analytic Functions
    • Comparison Functions
    • Date Functions
    • String Functions
  • API
    • Python Oracle
Home / Oracle Basics / The Basics of BINARY_FLOAT & BINARY_DOUBLE

The Basics of BINARY_FLOAT & BINARY_DOUBLE

Summary: in this tutorial, you will learn about the floating-point data types including BINARY_FLOAT and BINARY_DOUBLE.

Oracle 10g introduces two new floating point data types BINARY_FLOAT and BINARY_DOUBLE that allow you to store floating-point numbers in your table columns.

The floating-point numbers do not have the same precision as the NUMBER values, but they have a better performance for numerical computations. Because of this, the floating-point numbers are suitable for the scientific calculations but not suitable for financial calculations.

BINARY_FLOAT

  • IEEE 32 bit floating-point values
  • Range of +/3.4E+38
  • Precision of 6-7 digits
  • Require 4 bytes.

BINARY_DOUBLE

  • IEEE 64 bit floating-point value
  • Range of +/1.7E+308
  • Precision of 15 digits
  • Requires 8 bytes.

Oracle binary floating-point numbers support the special values Infinity and NaN (which stands for Not a Number) as follows:

Value BINARY_FLOAT BINARY_DOUBLE
Maximum positive finite value3.40282E+38F1.79769313486231E+308
Minimum positive finite value1.17549E-38F2.22507485850720E-308

To specify floating-point number literals, you add the suffix f for single precision and d double precision, as shown below:

SELECT 10.2d, 32.7f FROM dual;
Code language: SQL (Structured Query Language) (sql)

Oracle FLOAT vs. BINARY_FLOAT & BINARY_DOUBLE

The following are the major differences between FLOAT data type and floating-point data type:

  • The floating-point data types take advantage of hardware acceleration, therefore, they have better performance for numerical computations.
  • The floating-point data types can store smaller / larger numbers than FLOAT type.
  • The floating-point data types store only approximate values, while the FLOAT data type stores exact values.

In this tutorial, you have learned about the Oracle floating-point data types including BINARY_FLOAT and BINARY_DOUBLE.

  • Was this tutorial helpful?
  • YesNo
Previous Oracle FLOAT
Next Oracle Identity Column

Getting Started

  • What Is Oracle Database
  • Install Oracle Database Server
  • Download Oracle Sample Database
  • Create Oracle Sample Database
  • Connect To Oracle Database Server

Oracle Data Manipulation

  • SELECT
  • Oracle DUAL Table
  • ORDER BY
  • SELECT DISTINCT
  • WHERE
  • Table & Column Aliases
  • AND
  • OR
  • FETCH
  • BETWEEN
  • IN
  • LIKE
  • IS NULL
  • Joins
  • INNER JOIN
  • LEFT JOIN
  • RIGHT JOIN
  • FULL OUTER JOIN
  • CROSS JOIN
  • Self Join
  • GROUP BY
  • HAVING
  • UNION
  • INTERSECT
  • MINUS
  • GROUPING SETS
  • CUBE
  • ROLLUP
  • PIVOT
  • UNPIVOT
  • INSERT
  • INSERT INTO SELECT
  • INSERT ALL
  • UPDATE
  • DELETE
  • MERGE
  • Subquery
  • Correlated Subquery
  • EXISTS
  • NOT EXISTS
  • ANY
  • ALL

Oracle Data Types

  • Oracle Data Types
  • NUMBER
  • FLOAT
  • BINARY_FLOAT
  • CHAR
  • NCHAR
  • VARCHAR2
  • NVARCHAR2
  • DATE
  • INTERVAL
  • TIMESTAMP
  • TIMESTAMP WITH TIME ZONE

Oracle Data Definition

  • CREATE TABLE
  • Identity Column
  • ALTER TABLE
  • ALTER TABLE ADD Column
  • ALTER TABLE MODIFY Column
  • Drop Columns
  • DROP TABLE
  • TRUNCATE TABLE
  • RENAME Table
  • Oracle Virtual Column

Oracle Constraints

  • PRIMARY KEY
  • FOREIGN KEY
  • UNIQUE
  • CHECK
  • NOT NULL

Oracle Views

  • CREATE VIEW
  • DROP VIEW
  • Updatable Views
  • Inline Views
  • WITH CHECK OPTION

About Oracle Tutorial

OracleTututorial.com website provides Developers and Database Administrators with the updated Oracle tutorials, scripts, and tips.

Search

Recent Tutorials

  • Oracle Implicit Statement Results
  • Calling PL/SQL Stored Functions in Python
  • Calling PL/SQL Procedures in Python
  • Managing Transaction in Python
  • Deleting Data From Oracle Database in Python

Site Links

  • Oracle Books
  • About
  • Contact
  • Privacy Policy
  • Terms of Use

Copyright © 2021 Oracle Tutorial. All Rights Reserved.