Exact numeric types: decimal numbers  Money datatypes

Chapter 6: Using and Creating Datatypes

Approximate numeric datatypes

The numeric types float, double precision, and real store numeric data that can tolerate rounding during arithmetic operations.

Approximate numeric datatypes store, as binary tractions, slightly inaccurate representations of real numbers, stored as binary fractions. Anytime an approximate numeric value is displayed, printed, transferred between hosts, or used in calculations, the numbers lose precision. isql displays only six significant digits after the decimal point, and rounds the remainder. For more information on precision and approximate numeric datatypes, see the Reference Manual.

Use the approximate numeric types for data that covers a wide range of values. They support all aggregate functions and all arithmetic operations.

The real and double precision types are built on types supplied by the operating system. The float type accepts an optional precision in parentheses. float columns with a precision of 1 – 15 are stored as real; those with higher precision are stored as double precision. The range and storage precision for all three types is machine-dependent.





Copyright © 2005. Sybase Inc. All rights reserved. Money datatypes

View this book as PDF