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 .3 or 00.3.
  • Additional leading zeros are not relevant and FloatVer MUST ignore them. You MAY write 0001.0 but FloatVer 1.0 treats this as 1.0.
  • For versions where the fractional part is zero, exactly one trailing zero is required. This means write 23.0 and not 23.
  • Additional trailing zeros are not relevant and FloatVer 1.0 MUST ignore them. You MAY write 23.00000 but FloatVer 1.0 treats this as 23.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:

  1. one or more digit characters
  2. the dot character .
  3. 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])

  1. the character 0 OR one of the characters 1 through 9 followed by zero or more 0 through 9 characters
  2. the dot character .
  3. the character 0 OR zero or more of the characters 0 through 9 ending with exactly one of the characters 1 through 9

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.