Strict float equality, which -key removes by: never equal to an
integer, and 0.0 is not -0.0 (Erlang's =:= tells them apart, so
the reference's -key does too).
JSON has one number type too
the float as CASC writes it (CASC.md §7): 2.0, 1.0e3, inf
so f * 2 and f < 3 work on the number
Staticfrom
A CASC float (CASC.md §6.3), as a consumer's own tag receives one.
CASC tells
2.0from2, and so does the reference: its tags are handed an Elixir float, whichis_integer/1refuses. A JSnumbercannot carry that difference, so inside a load every float is aCooperFloat-- which is what lets"@{f}"read1.0,-key = [1.0]leave1alone, and!int(2.0)fail. A tag registered withtags:is handed the argument exactly as the pipeline holds it, so a float reaches it wrapped, nested ones included (in a list, a tuple, a map, or a secret); an integer is a plainnumber(or abigint). A tag may return aCooperFloattoo, and the value stays a float for the rest of the load. Once a tag handed its argument plain numbers, and could not tell!twice(2.0)from!twice(2).The loaded tree never holds one: every float in the result is a plain
number, the host's single number type.value,toNumber()andvalueOf()give the number, so arithmetic (f * 2) works on it as it is;toString()writes it as CASC does, always with a fraction (2.0,1.0e3,inf). Infinity is never wrapped by the pipeline --infhas no integer twin to be told apart from -- but a consumer may wrap it.