mirror of
https://github.com/semver/semver.git
synced 2026-07-10 19:50:47 -05:00
[GH-ISSUE #348] Rule 2 appears to forbid zero as a version number component #2970
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ediosyncratic on GitHub (Jan 5, 2017).
Original GitHub issue: https://github.com/semver/semver/issues/348
Rule 2: A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes.
The number 0 has a leading zero, but you do allow it in 0.1.0 and 1.0.0, etc.
I guess what you mean by "leading" in this case isn't just "it's the first digit" but also "it's redundant".
It may be simplest to say that X, Y and Z are natural numbers in canonical decimal form; the canonical form omits leading zeros save for 0 itself.
Alternatively, specify "counting number" to mean a sequence of decimal digits in which no zero is before another digit unless it is after another digit; then say that X, Y and Z are counting numbers.
@krzysiekpiasecki commented on GitHub (Jan 5, 2017):
https://en.wikipedia.org/wiki/Leading_zero
@ediosyncratic commented on GitHub (Jan 5, 2017):
I'm convinced :-)