Velocity Reviews > Java > more than 16 significant figures

# more than 16 significant figures

Raymond DeCampo
Guest
Posts: n/a

 07-15-2005
Dale King wrote:
> Patricia Shanahan wrote:
>
>> Dale King wrote:
>>
>>> Tom N wrote:
>>>
>>>>
>>>> Integers are able to represent accurately all values in their range,
>>>> whereas floats are only able represent accurately a small fraction
>>>> of the values in their range due to the limited size of the mantissa.
>>>
>>>
>>> It has more to do with the fact that the set of reals is uncountably
>>> infinite while the set of integers is countably infinite. There are
>>> an infinite number of reals between any two reals so no finite
>>> representation can represent all values over any range.

>>
>>
>> I don't think uncountability is really an issue here. The rationals are
>> countably infinite, yet there are an infinite number of rationals
>> between any two rationals so no finite representation can represent all
>> values in a range.

>
>
> Good point. After some research, the concept I was going after was dense
> ordered sets. The set of reals and the set of rationals are dense sets
> which means that for any two points a, b in X and a < b then there is
> another point x in X such that a < x < b.
>
> That is the property that makes it impossible to represent all values
> over a range with a finite representation.

Not really. For example, the set { 1/n | n is a positive integer } does
not have the property, but you cannot have a finite representation of
all such numbers in [0, 1].

Ray

--
XML is the programmer's duct tape.

Patricia Shanahan
Guest
Posts: n/a

 07-15-2005
Raymond DeCampo wrote:
> Dale King wrote:
>
>> Patricia Shanahan wrote:
>>
>>> Dale King wrote:
>>>
>>>> Tom N wrote:
>>>>
>>>>>
>>>>> Integers are able to represent accurately all values in their
>>>>> range, whereas floats are only able represent accurately a small
>>>>> fraction of the values in their range due to the limited size of
>>>>> the mantissa.
>>>>
>>>>
>>>>
>>>> It has more to do with the fact that the set of reals is uncountably
>>>> infinite while the set of integers is countably infinite. There are
>>>> an infinite number of reals between any two reals so no finite
>>>> representation can represent all values over any range.
>>>
>>>
>>>
>>> I don't think uncountability is really an issue here. The rationals are
>>> countably infinite, yet there are an infinite number of rationals
>>> between any two rationals so no finite representation can represent all
>>> values in a range.

>>
>>
>>
>> Good point. After some research, the concept I was going after was
>> dense ordered sets. The set of reals and the set of rationals are
>> dense sets which means that for any two points a, b in X and a < b
>> then there is another point x in X such that a < x < b.
>>
>> That is the property that makes it impossible to represent all values
>> over a range with a finite representation.

>
>
> Not really. For example, the set { 1/n | n is a positive integer } does
> not have the property, but you cannot have a finite representation of
> all such numbers in [0, 1].
>
> Ray
>

Yup. I think the actual condition for a finite representation is just:
Is the set of numbers you want to represent finite or not?

The dense set property is interesting because it indicates that there is
NO range containing at least two elements of the set over which all
elements of the set have a finite representation. Ray's set has a finite
representation for any range [x,1], where 0<x<1. The rationals and reals
don't.

Patricia

Tom N
Guest
Posts: n/a

 07-15-2005
Dale King wrote:

> Tom N wrote:
>>
>> Integers are able to represent accurately all values in their range,
>> whereas floats are only able represent accurately a small fraction of
>> the values in their range due to the limited size of the mantissa.

>
> It has more to do with the fact that the set of reals is uncountably
> infinite while the set of integers is countably infinite. There are an
> infinite number of reals between any two reals so no finite
> representation can represent all values over any range.

Finite = limited.

If the mantissa was not limited in size, that is, if it was infinite, then it could represent all reals.