<div dir="ltr"><br><div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-11 20:18 GMT+02:00 Bert Freudenberg <span dir="ltr"><<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div class="gmail-h5"><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><span style="font-family:arial,sans-serif;color:rgb(34,34,34)">On Wed, Oct 11, 2017 at 8:07 PM, Tobias Pape </span><span dir="ltr" style="font-family:arial,sans-serif;color:rgb(34,34,34)"><<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>></span><span style="font-family:arial,sans-serif;color:rgb(34,34,34)"> wrote:</span><br></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><div class="gmail-h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span><br>
> On 11.10.2017, at 19:59, Bert Freudenberg <<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>> wrote:<br>
><br>
> On Wed, Oct 11, 2017 at 5:24 PM, Tobias Pape <<a href="mailto:Das.Linux@gmx.de" target="_blank">Das.Linux@gmx.de</a>> wrote:<br>
> Hi all<br>
><br>
> I'm a bit stumped…<br>
><br>
> What is our canonical way to put a Float onto a (binary) stream?<br>
> To be precise a IEEE754 double precision 64-bit float onto a stream, of which I only know that it is a binary one.<br>
><br>
> I found ByteArray>>doubleAt:{put:}bigE<wbr>ndian:, but they have neither senders nor test _and_ it is not a stream.<br>
><br>
> What do y'all use?<br>
><br>
> You write them as two words, like e.g. in DataStream>>writeFloat:.<br>
<br>
</span>Quite. yes.<br>
<br>
But I find it strange that our read/write streams support various integer and string reading/writing helpers, but none for floats…<br>
<br>
Best regards<br>
<span class="gmail-m_4970682358037645684HOEnZb"><font color="#888888">        -Tobias<br></font></span></blockquote><div><br></div></div></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​I guess file formats using integers and strings are way more common than ones storing binary floats.</div><span class="gmail-HOEnZb"><font color="#888888"><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">- Bert -​</div></font></span></div></div></div>
<br><br></blockquote><div><br></div><div>Note that I consider word as a confusing term in Smalltalk, and particularly in Squeak...</div><div>Sometimes it's a uint16 as in PositionableStream>>nextWord (consistent with visualworks WordArray)<br></div><div>Sometimes it's a uint32 as in Squeak WordArray or Float>>basicAt: comment</div><div>Not speaking of the VM where BytesPerWord is also the size of pointer in underlying machine (either 4 or 8 bytes).</div><div><br></div><div>And note that Float may also be confusing for example thru ByteArray>>floatAt: and FloatArray...</div><div><br></div><div>Looking at Stream hierarchy, the nextInt32 (or int32) and co are implemented at a strange level (PositionableStream).</div><div>On one hand, they don't require the stream to be positionable and could be even higher...<br></div><div>On the other hand, they consider the stream to be operating on a sequence of bytes what it is not at this level of generality (it operates on a sequence of Objects).</div><div><br></div><div>In Xtream, support for such messages would probably require a specific wrapper...</div><div><br></div><div>While at it, I also wonder if we should not support the hexadecimal format %a of modern C/C++ for the purpose of interchange.</div><div><br></div><div>Nicolas<br></div><div><br></div></div><br></div></div></div>