How to convert a floating point number into a sequence of bytes so that it can be persisted in a file? Such algorithm must be fast and highly portable. It must allow also th
What do you mean, "portable"?
For portability, remember to keep the numbers within the limits defined in the Standard: use a single number outside these limits, and there goes all portability down the drain.
double planck_time = 5.39124E-44; /* second */
[...]
10 The values given in the following list shall be replaced by constant
expressions with implementation-defined values [...]
11 The values given in the following list shall be replaced by constant
expressions with implementation-defined values [...]
12 The values given in the following list shall be replaced by constant
expressions with implementation-defined (positive) values [...]
[...]
Note the implementation-defined in all these clauses.