Artifact a76692562eb99f2c8138435f4b8083377298de9b642423553f7dcb520fabced7:



<A NAME=EQUATION>

<TITLE>EQUATION</TITLE></A>
<b><a href=r37_idx.html>INDEX</a></b><p><p>



<B>EQUATION</B> _ _ _  _ _ _  _ _ _  _ _ _ <B>type</B><P>
<P>
 
 <P>
<P>
An <em>equation</em> is an expression where two algebraic expressions 
are connected by the (infix) operator 
<A HREF=r37_0110.html>equal</A> or by <em>=</em>. 
For access to the components of an <em>equation</em> the operators 

<A HREF=r37_0158.html>lhs</A>, 
<A HREF=r37_0175.html>rhs</A> or 
<A HREF=r37_0169.html>part</A> can be used. The 
evaluation of the left-hand side of an <em>equation</em> is controlled 
by the switch 
<A HREF=r37_0283.html>evallhseqp</A>, while the right-hand side is 
evaluated unconditionally. When an <em>equation</em> is part of a 
logical expression, e.g. in a 
<A HREF=r37_0052.html>if</A> or 
<A HREF=r37_0228.html>while</A> statement, 
the equation is evaluated by subtracting both sides can comparing 
the result with zero. 
<P>
<P>
Equations occur in many contexts, e.g. as arguments of the 
<A HREF=r37_0182.html>sub</A> 
operator and in the arguments and the results 
of the operator 
<A HREF=r37_0179.html>solve</A>. An equation can be member of a 
<A HREF=r37_0302.html>list</A> 
and you may assign an equation to a variable. Elementary arithmetic is supported
 
for equations: if 
<A HREF=r37_0283.html>evallhseqp</A> is on, you may add and subtract 
equations, and you can combine an equation with a scalar expression by 
addition, subtraction, multiplication, division and raise an equation 
to a power. 
 <P> <H3> 
examples: </H3>
<P><PRE><TT>
on evallhseqp;

u:=x+y=1$

v:=2x-y=0$

2*u-v; 

  - 3*y=-2


ws/3; 

    2
  y=--
    3

</TT></PRE><P><P>
<P>
Important: the equation must occur in the leftmost term of such an expression. 
For other operations, e.g. taking function values of both sides, use the 

<A HREF=r37_0163.html>map</A> operator. 
<P>
<P>


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]