Floating-Point Numbers: Chapter 1: Creating
Floating-Point Numbers: Chapter 1: Creating
If both the precision and scale are omitted, the default is ( 30, 6 ). If the preci-
sion is specified but the scale is omitted, the scale defaults to zero. If both the
precision and scale are specified, the scale must be in the range 0 <= scale <=
precision. In other words, the decimal point cannot be shifted away from the
actual digits of precision.
The storage requirements depend on the precision and scale of the actual
values stored, not the declared precision and scale. For example, 123456789
will take more storage than 123, and 1.123456789 will take more disk space
than 1.1. The formula for the bytes required is:
2 + TRUNCNUM ( ( p - s + 1 ) / 2, 0 ) + TRUNCNUM ( ( s + 1 ) / 2, 0 )
where p and s are the actual precision and scale after any leading and trailing
zeroes are ignored.