1

---+ 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):

---++ 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:

---++ 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.)


tRuEsAtM
  • 3,517
  • 6
  • 43
  • 83
Krazy Glew
  • 7,210
  • 2
  • 49
  • 62
  • 3
    A great question, but not a programming-related question – mob Feb 21 '17 at 20:37
  • You don't think so? The obvious follow-up question is "Does anyone have a library for this?" Or perhaps I'll put that in the title. I think that Ward Cunningham (inventor of wiki) said that the most important tool for a programmer is a thesaurus. – Krazy Glew Feb 21 '17 at 21:05
  • 1
    I also found the [d'Aboville](https://en.wikipedia.org/wiki/Genealogical_numbering_systems) to be suitable. However, similar ones are popping up in every field, from circuits to power-plants to text editing (see [Decimal outline](https://en.wikipedia.org/wiki/Outline_%28list%29)). – zdim Feb 21 '17 at 21:28
  • @zdim: Thanks! Make that into an answer, and I'll mark it best - especially if you can find libraries in any language for manipulating such "Decimal outline numbers" // I am tempted to call my own package "multidecimal outline numbers". // May not generalize as much as I would like, e.g. 1.a/b/c.2 (each .-digit having its own /-digit internally), but it's a start. – Krazy Glew Feb 21 '17 at 21:54
  • 1
    I did, mostly intended to be added to (if more/better comes up). – zdim Feb 21 '17 at 22:03

1 Answers1

1

I also found d'Aboville to be suitable, but it is genealogy specific and so raises such association.

Similar schemes pop up in all kinds of fields, ranging from circuits to power-plants to typography...

Perhaps the most generically sounding is Decimal outline. It is a kind of an Outline, used in writing

An outline, also called a hierarchical outline, is a list arranged to show hierarchical relationships and is a type of tree structure. It is used[1] to present the main points or topics of a given subject, often used as a draft or summary of the content of a document.

The first sentence is a perfect description for any such structure, I think. The second sentence is a bit suspect (specific), and the reference above is to the "Chicago Manual of Style."

The "Decimal outline" has the desired appearance, even though it refers to a document structure. Perhaps you can derive a name from it more generally referring to the decimal notation marking a hierarchical (tree) structure.


A less specific term is decimal notation, used in mathematics for far more generic purposes than the common separator in numbers. For example, an opening sentence from a paper

A decimal notation satisfies many simple mathematical properties. and it is a useful tool in the analysis of trees.

Another fairly generic term is Dot decimal notation

Dot-decimal notation is a presentation format for numerical data. It consists of a string of decimal numbers, each pair separated by a full stop (dot).

This short article is about IPv4 addresses but the term appears to be more general.


As for a library, searching for libraries related to IP addresses may lead somewhere.

zdim
  • 64,580
  • 5
  • 52
  • 81
  • This is the best answer so far (question up for less than a day). – Krazy Glew Feb 22 '17 at 00:13
  • This is the best answer so far (question up for less than a day). Much better than Dewey or d'Aboville, which are idiomatic, whereas "Decimal outline numbers" is self descriptive
    If anyone else posts a pointer to a library in any reasonable language that manipulates such "Decimal outline numbers", I reserve the right to switch the approved answer.
    I head slapped myself "Doh!" for not having googled "Outline numbering". Perhaps if org-mode handled them.
    Or I may split the question into terminology and code seeking.
    – Krazy Glew Feb 22 '17 at 00:21
  • @KrazyGlew A couple of more generic terms came up, updated. I didn't find a library, but looking at IP addresses (where there are many) may yield something general enough for a more generic use. – zdim Feb 22 '17 at 06:01
  • I am converging on "multipart outline numbers", since not necessarily decimal. I suppose not necessarily numbers, but what can you do. I wrote a Perl package, for the umpteenth time, that does what I need. I hope to be allowed to post; if not, then I will try to dig out some old code from university which does not belong to any company. – Krazy Glew Feb 22 '17 at 06:41