Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31154] Re: [mg31146] How do I eliminate premultipliers of "1." ?
  • From: BobHanlon at aol.com
  • Date: Sun, 14 Oct 2001 04:11:47 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 2001/10/13 4:16:23 AM, bap at roe.ac.uk writes:

>Consider the following:
>
>In[1] := 1 a / 1
>Out[1] := a
>
>In[2] := 1.0 a / 1.0
>Out[2] := 1. a
>
>Now consider these identities:
>
>In[3] := (1 / 1) == 1
>Out[3] := True
>
>In[4] := (1.0 / 1.0) == 1.0
>Out[4] := True
>
>In[5] := (1 / 1) == 1.0
>Out[5] := True
>
>In[6] := (1.0 / 1.0) == 1
>Out[6] := True
>
>Given that it is clear mathematically that I want the
>answer to In[2] to evaluate to just "a", and given that
>Mathematica is clearly recognizing that 1.0 / 1.0 is the
>same as 1 / 1, can someone please tell me why Out[2] contains
>the premultiplier "1." and how to eliminate it in expressions
>that might contain this superfluous unit multiplier in various places.
>

I would guess that it is retained to avoid implying that the result is exact. 
 That is, since inexact numbers were involved, an inexact result should be 
returned.  You can eliminate these artifacts using Rationalize.

1.0 a/1.0  // Rationalize

a

2.645 + 1.0a/1.0 // Rationalize // N

a + 2.645


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: Re: Simplex visualization
  • Next by Date: Re: Recursive Rules
  • Previous by thread: How do I eliminate premultipliers of "1." ?
  • Next by thread: Re: How do I eliminate premultipliers of "1." ?