• 23 Posts
  • 195 Comments
Joined 9 months ago
cake
Cake day: June 2nd, 2024

help-circle
  • That sounds like you ran into problems when deserializing a number value from JSON, which then got slightly changed due to floating point shenanigans. That’s technically not JSON’s fault. JSON numbers aren’t IEEE754. They’re just numbers. It’s only the deserializers that usually choose to represent JSON numbers as floating point values.

    Quoting https://www.rfc-editor.org/rfc/rfc8259#page-7

    A number is represented in base 10 using decimal digits. It contains an integer component that may be prefixed with an optional minus sign, which may be followed by a fraction part and/or an exponent part. […]

    A fraction part is a decimal point followed by one or more digits.

    Numeric values that cannot be represented in the grammar below (such as Infinity and NaN) are not permitted.

    This specification allows implementations to set limits on the range and precision of numbers accepted. Since software that implements IEEE 754 binary64 (double precision) numbers [IEEE754] is generally available and widely used, good interoperability can be achieved by implementations that expect no more precision or range than these provide, in the sense that implementations will approximate JSON numbers within the expected precision. A JSON number such as 1E400 or 3.141592653589793238462643383279 may indicate potential interoperability problems, since it suggests that the software that created it expects receiving software to have greater capabilities for numeric magnitude and precision than is widely available.




  • she doesn’t want to because she knows it will be a difficult conversation.

    That’s a lot of assuming. If we argue in her favor, then we might assume that her parents might not be the most receptive. This is a sensible assumption on her part. Any parent whose daughter is suddenly missing will be agitated. This state of mind is not conducive to a rational conversation.

    So her reaction makes sense: She asks her brother whom she views as a good bearer of news to just tell their parents that she is fine, so they don’t go crazy. After they’ve calmed down, she intends to explain herself.

    I think this is extraordinarily good thinking. Calling her parents immediately with the news that she’s gone will just end in a shouting contest. Not telling them at all is an undue burden on them and might have undesirable consequences like involving the police. This girl seems to do her best to have a calm talk. That’s way more than I’ve come to expect from adults.