|
[Date Index]
[Thread Index]
[Author Index]
Typing, Declare and Mma3.0
- To: mathgroup at smc.vnet.net
- Subject: [mg5002] Typing, Declare and Mma3.0
- From: jeremy_gorman at smtp.svl.trw.com (Jeremy Gorman)
- Date: Sat, 19 Oct 1996 02:25:48 -0400
- Organization: TRW ASG Sunnyvale (formerly ESL)
- Sender: owner-wri-mathgroup at wolfram.com
With Mma 2.2.2 I find:
In[1]:=
Re[Conj[Re[a]]]
Out[1]=
Re[Conj[Re[a]]]
Type checking is either insufficiently stringent or fails
to distribute properly over the Conj[] function.
I tried using Declare.m from Mathsource, to resolve this,
but still I get:
In[129]:=
Declare[a,Real]
In[130]:=
Re[Conj[a]]
Out[130]=
Re[Conj[a]]
Does Mma 3.0 resolve this for me? If not, is there
some newer Declare.m that will? Can someone suggest how to
extend Declare.m to take care of this for me -- here's what
appears to be the salient part of Declare.m:
Unprotect[RealQ]
RealQ[x_ + y_]:= RealQ[x] && RealQ[y]
RealQ[x_ y_]:= RealQ[x] && RealQ[y]
RealQ[_Real] = True
RealQ[_Integer] = True
RealQ[_Rational] = True
RealQ[_Complex] = False
RealQ[Re[_]] = True
RealQ[Im[_]] = True
RealQ[Arg[_]] = True
RealQ[Abs[_]] = True
RealQ[_?NonNegative ^ _?RealQ] = True
RealQ[_?Negative ^ x_]:= False /; !IntegerQ[x]
RealQ[_?RealQ ^ _?IntegerQ] = True
RealQ[_] = Uncertain
Protect[RealQ]
Unprotect[Re,Im]
Re[x_?RealQ] = x
Im[_?RealQ] = 0
Protect[Re,Im]
Thanks in advance,
Jeremy
/*\ \*/ /*\ \*/ /*\ \*/ /*\ \*/ /*\ \*/ /*\ \*/ /*\ \*/ /*\ \*/
Jeremy Gorman "Just a Comment"
Most of my opinions are my own (especially if expressed here) !
/*\ \*/ /*\ \*/ /*\ \*/ /*\ \*/ /*\ \*/ /*\ \*/ /*\ \*/ /*\ \*/
Prev by Date:
LinearSolve[] leads to core dump; why?
Next by Date:
FreeExpr called on live expr.
Previous by thread:
Re: Typing, Declare and Mma3.0
Next by thread:
Working Precison
|