W
W
wideShift2021-12-22 16:24:06
PostgreSQL
wideShift, 2021-12-22 16:24:06

What does the accuracy of at least 6 digits mean for real?

Statement:
On most platforms, the real type can store values ​​between 1E-37 and 1E+37 with at least 6 decimal digits of precision.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2021-12-22
@wideShift

What do you think this could mean?
6 significant digits guaranteed, i.e. 123456 can be stored, but 123456789 can, but with loss of precision:

postgres=# select 123456789::real;
    float4
---------------
 1.2345679e+08

These are in fact the usual limitations of a 4 byte float , with some margin.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question