Re: Serialization of binary floating point numbers

2019-05-19 Thread Sad Clouds
On Sat, 18 May 2019 22:14:24 -0500 "J. Lewis Muir" wrote: > On 05/17, Sad Clouds wrote: > > A bit of a random question/thought - what is a good and portable > > method of storing/transmitting binary floating point numbers? > > Maybe heavier than you'd like, but Protocol Buffers has a double type

Re: Serialization of binary floating point numbers

2019-05-18 Thread J. Lewis Muir
On 05/17, Sad Clouds wrote: > A bit of a random question/thought - what is a good and portable method > of storing/transmitting binary floating point numbers? Maybe heavier than you'd like, but Protocol Buffers has a double type: https://developers.google.com/protocol-buffers/docs/proto3#scalar

Re: Serialization of binary floating point numbers

2019-05-18 Thread Rhialto
I recall reading of a hexadecimal serialization of floating point numbers. I'm not sure of all the details, but it sounds like it would be a fairly easy way to exactly represent a whole class of FP formats. -Olaf. -- ___ Olaf 'Rhialto' Seibert -- "What good is a Ring of Power \X/ rhialto/at/falu

Re: Serialization of binary floating point numbers

2019-05-18 Thread Sad Clouds
On Sat, 18 May 2019 17:23:57 +0200 Martin Husemann wrote: > On Sat, May 18, 2019 at 08:58:35AM +0100, Sad Clouds wrote: > > what I can see most of the modern hardware use 2's complement > > integer arithmetic and IEEE 754 floating point, but not sure if > > there are any specific exceptions I'm n

Re: Serialization of binary floating point numbers

2019-05-18 Thread Martin Husemann
On Sat, May 18, 2019 at 08:58:35AM +0100, Sad Clouds wrote: > what I can see most of the modern hardware use 2's complement > integer arithmetic and IEEE 754 floating point, but not sure if there > are any specific exceptions I'm not aware of. There are variations in the ieee 754 formats though, a

Re: Serialization of binary floating point numbers

2019-05-18 Thread Sad Clouds
On Fri, 17 May 2019 21:06:14 +0200 Rhialto wrote: > On Fri 17 May 2019 at 17:37:45 +0100, Sad Clouds wrote: > > 1. Make sure software always built to use IEEE 754 format. > > For VAX, you would need to do some work there, since it natively uses > a different floating point format. It is the cano

Re: Serialization of binary floating point numbers

2019-05-17 Thread Rhialto
On Fri 17 May 2019 at 17:37:45 +0100, Sad Clouds wrote: > 1. Make sure software always built to use IEEE 754 format. For VAX, you would need to do some work there, since it natively uses a different floating point format. It is the canonical example for that, these days :-) I'm not up to date on w

Serialization of binary floating point numbers

2019-05-17 Thread Sad Clouds
A bit of a random question/thought - what is a good and portable method of storing/transmitting binary floating point numbers? Anyone aware of any conversion functions in NetBSD that I can look at? Searching the Internet, there are various opinions and references on how to do it, but there doesn't