Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

15
  • 10
    @Kakturus Option<Option<Int>> Commented Aug 14, 2018 at 15:20
  • 5
    @Bergi You can't possibly think that's even remotely acceptable.. Commented Aug 14, 2018 at 16:43
  • 8
    @BlueRaja-DannyPflughoeft Actually it fits the OPs description quite well, which has a nested structure as well. To become acceptable we'd introduce a proper type alias (or "newtype") of course - but a type Measurement = Option<Int> for a result that was an integer or an empty read is ok, and so is an Option<Measurement> for a measurement that might have been taken or not. Commented Aug 14, 2018 at 19:00
  • 7
    @arp "Integers near NaN"? Could you explain what you mean by that? It seems somewhat counterintuitive to say that a number is "near" the very concept of something not being a number. Commented Aug 14, 2018 at 19:19
  • 3
    @Nic Hartley In our system a group of what would "naturally" have been the lowest possible negstive integers was reserved as NaN. We used that space for encoding various reasons why those bytes represented something other than legitimate data. (it was decades ago and I may have fuzzed some of the details, but there was definitely a set of bits you could put into an integer value to make it throw NaN if you tried to do math with it. Commented Aug 14, 2018 at 20:15