Opened 8 years ago

Last modified 8 months ago

#162 assigned question

*§23.1 does not define "<floating-point-number>"

Reported by: Josh Owned by: Simon Cox
Priority: minor Milestone:
Component: help Keywords:


§23.1 states that Special units are defined with:

` The BNF for the special expression is <special-unit> ::= <function-symbol>“(”<floating-point-number>“ ”<term>“)” The function symbols are defined as needed. `

But there is no language explaining what <floating-point-number> means. Does it relate back to any definitions in §21 or §22? Perhaps it has something to do with one or more of the components in the quadruple s = (u, fs, fs-1, α)?

Some explanation would help.

Change History (4)

comment:1 Changed 7 years ago by Gunther Schadow

Yes, floating point number has an assumed definition as decimal with optional scientific notation. There are additional consideration that relate to the implicit specification of the number of significant digits. These issues have been discussed in another work (the HL7 v3 Data Types standard).

We have tried to keep this outside the UCUM specification, because we might have to include standardization of real numbers in computer notation into UCUM.

You may use the Java floating point notation for an example. Most other languages, e.g., SQL are quite similar and differences occur only in edge cases.

In the writing of numbers internally we use some rules:

  • if the number is precise, write the digits without any decimal point, and use the "e" exponent to scale it back. E.g. G = 9.80665 m/s2 (exact) we write as 980665e-5.
  • if the number is estimated, write with decimal point, e.g., even if 100 is an estimate, we would write 100. or 1.00e2

But this is of interest only in the internal notation we might use in any formal data tables. The UCUM standard as published in text does not make that distinction.

Perhaps we should speak about this, but for us floating point number is a primitive.

comment:2 Changed 18 months ago by Brenée Mitchell

Component: help
Owner: set to Simon Cox
Status: newassigned

comment:3 Changed 18 months ago by Simon Cox

There is a good argument to use xsd:decimal in preference to xsd:float or xsd:double for transfer - see . In XML (and RDF) representations there is a particular risk around 0.1, 0.01, 0.001 etc which are not exactly equal to 1/10, 1/100, 1/1000 etc in the digital approximation. So there is a case for replacing all the multipliers in the ucum-essence.xml file with xsd:decimal throughout.

I'd be interested in other views here.

comment:4 Changed 8 months ago by Brenée Mitchell

Summary: §23.1 does not define "<floating-point-number>"*§23.1 does not define "<floating-point-number>"
Note: See TracTickets for help on using tickets.