For purposes of given math module (that performs some statistical computations) it's sufficient to store reals in IEEE754 floating point format. I'm considering to migrate to SQLLite as persistent storage. But documentation of SQLLite doesn't clearly state what standard it supports. SQLLite wiki says it supports REAL:
REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number.
But there are two different IEEE standards for floating-point computation. IEEE 754 (b = 2) and IEEE 854(b = 2 or b = 10). I need to store IEEE 754 single precision float or double in SQLLite column and later read this value into variable with original precision (single or double) in IEEE 754 format (no need any arithmetic).
Two sub-problems appear: one about storing doubles and another about storing single precision values in target unknown 8-byte floating point number.
storing doubles: can I be confident that I will read the same binary value (754 has unique binary representation), including all kinds of NaN, pos/neg infinity, etc. (in other words: is SQLLite lossless with regard to IEEE754 doubles)?
storing single float to double: is this conversion reversible? This problem is about IEEE754 standard in general and doesn't relate to any specific software.
This question is not only about math-software and SQLLite - it's about representation of floats in different formats and losses related to conversions. Useful introduction article about this topic here - What Every Computer Scientist Should Know About Floating-Point Arithmetic