Re: How do I eliminate premultipliers of "1." ?

• To: mathgroup at smc.vnet.net
• Subject: [mg31169] Re: How do I eliminate premultipliers of "1." ?
• From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
• Date: Tue, 16 Oct 2001 01:18:44 -0400 (EDT)
• References: <9q8oeb\$co\$1@smc.vnet.net> <9qbi0g\$2d4\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```"Alan Mason" <swt at austin.rr.com> wrote:
> ..  I agree with you, though.  Mathematica 4.1 even claims
> that 1.0 == 1 is True.
>
> I consider this an outright error. 1.0 means a floating-point
> approximation to 1, whereas 1 is exactly 1

It's not an error.
Of course, a Real is a different type of number from an Integer. But to
evaluate the logical expression in a reasonable fashion, the Integer must
first be converted to Real.

You might note that, using default settings,
0.33333333333333 == 1/3 is True, while
0.3333333333333  == 1/3 is False.
This is as it should be.

> The correct way to treat 1.0/1.0 is somewhat ambiguous.
> Does 1.0 stand for the same approximation at each
> appearance?

It stands for the same Real at each appearance.

> If so, the ratio should be 1; otherwise, it should be 1.0.

It should be 1.0 because, in general, Real/Real must give Real.

David

--