Automation and Artificial Intelligence
A telemetry file must encode a threshold of 0.25 as a JSON number. Which member uses valid JSON number syntax?
Show the answer
Correct answerC. "threshold": 2.5e-1
AWhy not this: JSON does not permit extra leading zeros in the integer part.
BWhy not this: JSON requires an integer part before the decimal point.
CWhy this is right: Exponent notation is valid JSON number syntax, and this value equals 0.25.
DWhy not this: JSON permits a leading minus sign, but not a leading plus sign.
JSON permits an exponent, so 2.5e-1 represents 0.25. A fractional number requires an integer part; JSON also prohibits a leading plus sign and extra leading zeros.