MathGroup Archive 2005

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

Search the Archive

Re: Re: Confusing results with N[expr]?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62356] Re: [mg62327] Re: Confusing results with N[expr]?
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Tue, 22 Nov 2005 04:41:58 -0500 (EST)
  • References: <dlp320$1bs$1@smc.vnet.net> <200511210854.DAA22039@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 21 Nov 2005, at 17:54, Peter Pein wrote:

> 2.)
> Unprotect[Power];
> Power /: N[(x_)^(y_)] := Pow$[N[x], N[y]];
> Protect[Power];
> $Post = #1 /. Pow$ -> Power & ;
>

Well, I would not recommend it. As often happens if you change one of  
the basic arithmetic functions,  there is be a price to pay if you do  
this. Here is an example:

In[1]:=
Unprotect[Power];
Power /: N[(x_)^(y_)] := Pow$[N[x], N[y]];
Protect[Power];
$Post = #1 /. Pow$ -> Power & ;

In[5]:=
Solve[N[x^2 - 1 == 0], x]

"Inverse functions are
     being used
       by   so some solutions may not be \
found; use Reduce for complete solution information.

Out[5]=
{}

Solving polynomial equations has suddenly become  harder (although,  
of course, if you do not use N things will still work fine).

Andrzej Kozlowski


  • Prev by Date: Re: How to read a data file in text format?_from a new learner
  • Next by Date: Re: Export[] to XLS
  • Previous by thread: Re: Confusing results with N[expr]?
  • Next by thread: Re: Re: Confusing results with N[expr]?