Input and interpretation of Intervals with machine-precision bounds
- To: mathgroup at smc.vnet.net
- Subject: [mg86300] Input and interpretation of Intervals with machine-precision bounds
- From: "Andrew Moylan" <andrew.j.moylan at gmail.com>
- Date: Sat, 8 Mar 2008 05:39:00 -0500 (EST)
How can I input the Interval representing all numbers between the
machine-representable number 3. and the machine representable number 4.?
Interval[{3., 4.}] // InputForm
yields
Interval[{2.9999999999999996, 4.000000000000001}]
Note that re-entering this //InputForm output widens the interval even
further again:
Interval[{2.9999999999999996, 4.000000000000001}] // InputForm
yields
Interval[{2.999999999999999, 4.000000000000002}]
It's strange that entering the InputForm doesn't recover the original
expression! Is this by design?
Here's one way to obtain the Interval between 3. and 4.:
Interval[{3.0000000000000004, 3.9999999999999996}] // InputForm
In other words, one can pre-empt Mathematica's widening of the interval by
contracting it. But this doesn't leave us with any way of obtaining
Interval[{3., 3.}]. This seems strange since Interval[{3, 3}] is an
acceptable interval.