isd changed the topic of #sandstorm to: Welcome to #sandstorm: home of all things sandstorm.io. Say hi! | Have a question but no one is here? Try asking in the discussion group: https://groups.google.com/group/sandstorm-dev | This channel is logged at: https://freenode.irclog.whitequark.org/sandstorm/
griff__ has joined #sandstorm
Mitar has quit [Ping timeout: 252 seconds]
Mitar has joined #sandstorm
Mitar has quit [Ping timeout: 240 seconds]
Mitar has joined #sandstorm
dustyweb has quit [Remote host closed the connection]
dustyweb has joined #sandstorm
dustyweb has quit [Remote host closed the connection]
dustyweb has joined #sandstorm
griff__ has quit [Quit: griff__]
griff__ has joined #sandstorm
griff__ has quit [Quit: griff__]
griff__ has joined #sandstorm
<simpson> Redirect from #erights: How are the exceptional floats encoded? I think -0.0, Infinity, and -Infinity all encode to unique forms. How about NaN?
<simpson> The context is canonicalizing buffers as a prelude to encryption and signing.
<isd> capnproto doesn't do any normalization of floats whatsoever. The canonicalization algorithm can't even tell what's a float vs. an integer (all you can tell without a schema is "not pointer")
<isd> So, good chance if you put NaNs in your message they may not come out the the same bytes.
<isd> *to the
<isd> I'm... not convinced this is worth worrying about. Relying on equality of floats is going to result in brittle software in general.
<simpson> It does sound brittle, doesn't it.
TMM has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
TMM has joined #sandstorm
<isd> Also, fwiw, normal semantics of NaN is that it's not equal to anything, not even itself.
<isd> equality on floats is not even an equivalence relation.
<simpson> Meh. It's language-dependent; in Monte, m`NaN == NaN` is true and it's not possible to control the inner bits of NaNs.
<simpson> (I wrote earlier today about how to make this work practically: https://lobste.rs/s/1zbtpo/on_sameness_programming_fundamental#c_mpyjhg)
<isd> Well, IEEE-754 semantics. It is of course possible, and perhaps reasonable, to write software that deviates from the standard.