FloatVer 1.0
Describing the 1.0 version of FloatVer
FloatVer 0.0
FloatVer was first proposed by me in 2024. To discourage haphazard adoption, the time for a standardized 1.0 release is long overdue. This document will describe the 1.0 version of FloatVer itself, and the previously described version is now named FloatVer 0.0.
FloatVer 1.0
FloatVer is a notation meant to be easily read and written by both humans and machines. Limiting FloatVer numbers to values within 32-bit IEEE754 floating-point numbers satisfies the machine. Further limitations on FloatVer make it easier for humans to use. Not all of these limitations were described in the proposal document, so this 1.0 document will clear up any ambiguities.
Leading/trailing zero
In FloatVer 0.0 a leading zero is "ignored except when BREAK or NOBREAK is zero". This could be interpreted to mean that leading zeros are optional.
FloatVer 1.0 clarifies the matter:
- For versions less than 1.0, exactly one leading zero is required.
For example, the version which is equal to the ratio 3/10 MUST use the notation
0.3, not.3or00.3. - Additional leading zeros are not relevant and FloatVer MUST ignore them.
You MAY write
0001.0but FloatVer 1.0 treats this as1.0. - For versions where the fractional part is zero, exactly one trailing zero is required.
This means write
23.0and not23. - Additional trailing zeros are not relevant and FloatVer 1.0 MUST ignore them.
You MAY write
23.00000but FloatVer 1.0 treats this as23.0.
Syntax
The regular expression [0-9]+\.[0-9]+ MUST be able to parse any valid FloatVer 1.0 version. In layperson's terms, this expression denotes the component parts of a FloatVer 1.0 version, in order:
- one or more digit characters
- the dot character
. - one or more digit characters
This regular expression also parses 009.3000, but because of the leading/trailing zero rules above this is equivalent to 9.3.
This more accurate regular expression captures the leading/trailing zero rules: (0|[1-9][0-9]*)\.(0|[0-9]*[1-9])
- the character
0OR one of the characters1through9followed by zero or more0through9characters - the dot character
. - the character
0OR zero or more of the characters0through9ending with exactly one of the characters1through9
IEEE754 compatibility
Not all sequences of characters that match the above syntax rules are valid 32-bit floating point values according to IEEE754. This is because floating point trades precision for range. However, every FloatVer version MUST be a valid IEEE754 32-bit value. One pragmatic approach to this problem is to convert a candidate version number into a valid IEEE754 number before declaring it to be a FloatVer 1.0 version. This can be accomplished by parsing the number with a web browser's JavaScript engine, either by embedding it in a web page or by using the browser's JavaScript console (if avialable).
Is FloatVer 1.0 a valid version of FloatVer itself?
The most important feature of FloatVer is its definition of breaking and nonbreaking changes. A breaking change can only occur if there is a backward-incompatible change. Because FloatVer 0.0 did not specify either (a) what its own version is or (b) how many leading/trailing zeros are allowed, the changes outlined here for FloatVer 1.0 are breaking changes.
Therefore, FloatVer 1.0 is a valid version change according to the rules of FloatVer 0.0. Try not to think about it too hard.