Skip to content

Comment on Show HN: Python JSON library in Rust, faster than ujsonparent

Comments

JSON doesn't support NaN or infinity, so most JS implementations emit null for NaN, +Inf, -Inf. In Node:

  > JSON.stringify({nan: 0/0, inf: 1/0, neginf:-1/0})
  '{"nan":null,"inf":null,"neginf":null}'
I'm not sure if throwing an exception is better or worse.

Ok, but the line I quoted wasn't about infinity, it was about numbers that were "too large", which I assume means bignums.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.