Re: Precision of numbers using JSON Header Field Values

--------
In message <CANatvzwDMF50KcFGR72SUtLCJc6fqJJ2pZaCOK9qv2RK5vZ+=g@mail.gmail.com>
, Kazuho Oku writes:

>For example, using node.js v.6.2.1,
>0.0000000000000000000000000000000000000000000000000000000000000000000000000=
>000000000000000000000000000000000000000000000000000000000000000000000000000=
>000000000000000000000000000000000000000000000000000000000000000000000000000=
>000000000000000000000000000000000000000000000000000000000000000000000000000=
>000000000000000000000000000000000000000000000000000000000000000000000000000=
>000000000000000000000000100e400
>is evaluated as 100. OTOH, using ruby 2.0.0, the same expression is
>interpreted as zero.

Seriously, the problem here is not the implementations trying to
make sense of this number, as much as the fact that it is legal
to transmit it that way.

Given that HTTP is a public access interface, we really should not
allow that kind of inane flexibility.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

Received on Friday, 15 July 2016 07:08:11 UTC