0
votes

There are two different IEEE standards for floating-point computation. IEEE 754 (b = 2) and IEEE 854(b = 2 or b = 10). SQLLite wiki says:

REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number.

I need to store IEEE 754 double in SQLLite column and later read this value (no need any arithmetic). Can I be confident that I will read the same binary value (754 has unique binary representation), including all kinds of NaN, etc. (in other words: is SQLLite lossless with regard to IEEE754 doubles)?

1

1 Answers

1
votes

I think it depends on the sqlite version (It doesn't, read below)

I've found other definitions for REAL:

REAL: The value is a floating-point number, stored as an 8-byte value in the processor's native format. For most modern processors, this is an IEEE 754 double-precision number. Literal floating-point numbers are represented by any bare series of numeric digits that include a decimal point or exponent.

Source

A similar definition is found in O'Reily Using Sqlite

But latest sqlite3 says IEEE, so it is IEEE 754


EDIT:

Sqlite version 2.* was typeless.

the oldest version of the doc I've found matches with sqlite 3.0.0 alpha release date and has not changed.

The books I cited might have been based on pre alpha documentation.