---+ BRIEF
What do you call a numbering system that contains multiple decimals?
And, can you point me to any standard libraries that manipulate such multiple-decimal-strings?
E.g.
1
1.1
...
4.1
4.1.1
...
4.1.77
...
167.966.451.8787.0.1771.88 ...
I have often called this a Dewey decimal numbering system, but poking around I see that Dewey Decimal Classification is a proprietary system.
Another candidate name might be "tree node numbering," with a 'root of all things' and numbers corresponding to the i-th child of any link.
Is there any widely used term for this sort of numbering?
---+ BEST SO FAR
---++ Best Name So Far
The best names for this found so far are (IMHO):
- decimal outline(reported by @zdm)
- d'Aboville Numbers from genealogy.
---++ Best Code So Far
There are quite a few libraries that deal with version numbers, but most have silly hardwired limits, like major.minor.path.
I will fill this in when I get a good reference.
I had written such libraries several times over, in several languages - but have usually had to leave them behind when I changed employer.
---+ DETAIL
I often find myself creating numbering schemes that contain multiple decimals, e.g. 56.23.8.99.
I have called these "Dewey decimal numbers" for a very long time, probably because I first encountered these in a library. But another folk sometimes object, pointing out that Dewey Decimal Classification is a proprietary system. If they see a class Dewey_Decimal_Number
, they think that it is specific to libraries of books, and are surprised to see me use it for other things, with numbers that in no way correspond to the official Dewey decimal numbering scheme.
I.e. I am looking for a generic name that includes the specific instances of such multiple-decimal numbering schemes that we encounter over and over again:
- Network addresses, such as IPv4 192.168.0.1
- Library numbering, e.g./ Dewey 796.12
- [Software Version Numbers][https://en.wikipedia.org/wiki/Software_versioning] like major.minor (1.1), major.minor.patch (25.24.1) or major.minor.maintenance.build or ...
- section numbers in a book, e.g., "In Section 5.1.4"
- in my work, numbers for speculative spawned hardware threads
- genealogy, many [genealogical numbering schemes][http://www.eogen.com/NumberingSystems], e.g. closest [d'Aboville Numbers][http://www.eogen.com/dAbovilleNumbers], Henry numbers, etc.
- phylogenetic trees
---++ Code Design Considerations
No limit on length, the number of components, etc.
I don't care if the separator is a period, or something else. E.g. 5.29.6 and 5/29/6 are pretty much isomorphic to a vector of sortable components,
Hmm..., perhaps I should call it "path name numbering," giving credit to the UNIX hierarchical filesystem.
For that matter, in many use cases, I don't necessarily care that the components are numbers.
Usually, I do operations such as sorting. 1 < 1.1 < 1.10 < 2
.
... String cmp, or numeric <=> ?
More rarely, I do operations like "Is this allowed?" e.g.
allowed_as_neighbors(1, 1.1)=>true
allowed_as_neighbors(1, 2)=>true
allowed_as_neighbors(1.1, 2)=>true
allowed_as_neighbors(1, 1.2)=>false, since canonically need a 1.1 in between
allowed_as_neighbors(1, 1.1.1)=>false, since need a 1.1 in between
Often, I convert between the more human-friendly variable length multi-decimal-numbering to a fixed bit width, like 32 or 64 or 128-bits, that is easier to manipulate.
This can be nested: 1.a/b/c.2
, where the components are (1, a/b/c, 2)
, and a/b/c
is itself a multicomponent vector (a, b, c)
. I.e. separators may have a binding strength or priority.
---+ CONCLUSION
Like I said, I am not looking for code on this question - I am just looking for some hopefully common name for this sort of thing.
(Actually, I am looking for code. I had written such libraries many times (and left them behind when I changed jobs). If there are any standard libraries for this, I'd like to know. If not, I'd like a good name for my libraries.)