[Last-Call] Re: Artart last call review of draft-ietf-cbor-cddl-more-control-07

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Darrel,

thank you for this thoughtful observation.

> My only concern is the use of the the term "decimal" to only support integers. 

In CS, “decimal” is a synonym for “base-10” [1].

[1]: https://en.wikipedia.org/wiki/Decimal

As you note, many people only ever notice that they are using decimal (base-10) text representations of numbers in conjunction with decimal fractions (as opposed to ratio-based fractional notation, i.e., numerator/denominator notation), so:

> Common programming languages like Java, Go, C# and Python use the term decimal
> to support fixed-point numbers.  JSON Schemas regularly use "decimal" with the
> "format" keyword to convey fractional numbers.  It is also common to use JSON
> strings to convey large decimal floating point numbers as has been captured
> here in the format registry for JSON Schemas used with OpenAPI
> https://spec.openapis.org/registry/format/decimal128.html

Right, that semantic narrowing of “decimal" is common, if somewhat confused, usage.
We indeed need to accommodate the potential for confusion.

(From a CS theory point of view, decimal fractions are just the base-10 form of the general concept of fractions in a positional numeral system — note that the %a in .printf actually supports hexadecimal fractions, and nobody would think of semantically narrowing “hexadecimal” to fractional numbers.)

> Is there a reason for not calling the operator .integer instead, considering
> only integer values are supported?

There could be variants of a .integer number-to-text operator in base 16 (hex), base 2 (binary/dual), etc.; the one we are defining here is the base-10 one, and “decimal” was an attempt to express this in the name.

The same specification also provides control operators for base-nn representation of byte strings (.b64u etc.), so just calling the operator .base10 could be confusing by confounding text representations of byte strings with those of integers.

The verbose solution would be .decimal-integer or .base10-integer.
There also is the obscure word “denary”.

All this considered, I’m leaning towards ".base10".

Grüße, Carsten

-- 
last-call mailing list -- last-call@xxxxxxxx
To unsubscribe send an email to last-call-leave@xxxxxxxx




[Index of Archives]     [IETF Annoucements]     [IETF]     [IP Storage]     [Yosemite News]     [Linux SCTP]     [Linux Newbies]     [Mhonarc]     [Fedora Users]

  Powered by Linux