[fpc-pascal] Writing floating points to steams

Serguei TARASSOV serge at arbinada.com
Wed Jan 13 09:27:24 CET 2016


On 13/01/2016 08:47, fpc-pascal-request at lists.freepascal.org wrote:
> On 2016-01-12 10:45, Torsten Bonde Christiansen wrote:
>> Since TStream doesn't have any native WriteFloat/Double and the likes,
>> some conversion is needed - but what is a good strategy for this?
Depends on size constraints.
In the simple case you should convert float to locale-independent string 
value (no spaces, no commas separators) then write it.
If the size does matter, you may convert float to corresponding byte 
array then write it.

Regards,
Serguei



More information about the fpc-pascal mailing list