Re: Accuracy of 754-compliant recommended functions
All
The definition of quantum in 754 §2.1.44 certainly looks like an ulp.
My understanding of the alternative representations for decimal numbers is as follows. Suppose we use decimal64, which (754 Table 3.2) has 16 digits in the significand. Then the mathematical number 1.23456789 can be stored exactly as any of
1.234567890000000*10^0 or 0.123456789000000*10^1 or ... or 0.000000123456789*10^7
(8 possibilities, i.e. one more than the number of trailing zeros in the first, normalised, representation.)
The quantum is 10^(-15) in the first, ... 10^(-8) in the last.
Am I understanding correctly?
John P
On 1 Jul 2013, at 18:24, Ralph Baker Kearfott wrote:
> OK, now I think I understand, although I'd like to
> study 754 a bit more. I'm imagining a "quantum"
> in a decimal format to be "language defined" by
> the number of digits printed (or input).
>
> With this interpretation, I'm more at ease if
> we were to require 754-conformant data types to provide
> optimal enclosures for recommended functions, since
> the 754-standard itself requires such functions, if
> supplied, to be optimally rounded, subject to the
> rounding mode in effect.
>
> Best regards,
>
> Baker
>
> On 07/01/2013 11:47 AM, Vincent Lefevre wrote:
>> On 2013-07-01 09:53:23 -0500, Ralph Baker Kearfott wrote:
>>> Does this mean that, if the functions recommended in 754-2008 are
>>> provided, they must return the nearest floating point number
>>> subject to the rounding mode in effect?
>>
>> Yes. But whar you had said wasn't clear.
>>
>>> That is what I originally
>>> thought it said. The relevant sections of 754-2008 are
>>> Clause 9.1, in which it says "A conforming
>>> function shall return results correctly rounded for the applicable rounding
>>> direction for all operands
>>> in its domain. The preferred quantum is language-defined," and
>>> the definition of quantum: "2.1.44 quantum: The quantum of a finite
>>> floating-point representation is the value of a
>>> unit in the last position of its significand. This is equal to the radix
>>> raised to the exponent q, which
>>> is used when the significand is regarded as an integer."
>>>
>>> Where do you get that a quantum is defined only for decimal?
>>
>> I think that what Michel meant was that there may be different choices
>> for the quantum only in decimal (where the representation isn't
>> necessarily normalized, contrary to binary).
>