[fpc-pascal] Writing floating points to steams

Marco van de Voort marcov at stack.nl
Wed Jan 13 10:43:32 CET 2016


In our previous episode, Torsten Bonde Christiansen said:
> What is the best/preferred way to write floatingpoint to a steam?


var d : double; // or single, avoid extended

d:=<some expression>;
stream.write(d,sizeof(d));

stream.read(d,sizeof(d));

All the stream helpers are just that.

One could add writedouble/single to the stream typehelpers in streamex.




More information about the fpc-pascal mailing list