File r37/lisp/csl/html/r37_0098.html artifact 222aec016e part of check-in 3c4d7b69af



<A NAME=QUOTIENT>

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



<B>QUOTIENT</B> _ _ _  _ _ _  _ _ _  _ _ _ <B>operator</B><P>
<P>
 
The <em>quotient</em> operator is both an infix and prefix binary operator that 

returns the quotient of its first argument divided by its second. It is 
also a unary 
<A HREF=r37_0101.html>recip</A>rocal operator. It is identical to <em>/</em> and
 

<A HREF=r37_0030.html>slash</A>. 
 <P> <H3> 
syntax: </H3>
<P>
<P>
<em>quotient</em>(&lt;expression&gt;,&lt;expression&gt;) or 
&lt;expression&gt; <em>quotient</em> &lt;expression&gt; or 
<em>quotient</em>(&lt;expression&gt;) or 
<em>quotient</em> &lt;expression&gt; 
<P>
<P>
<P>
&lt;expression&gt; can be any valid REDUCE scalar expression. Matrix 
expressions can also be used if the second expression is invertible and the 
matrices are of the correct dimensions. 
 <P> <H3> 
examples: </H3>
<P><PRE><TT>
quotient(a,x+1); 

    A
  ----- 
  X + 1


7 quotient 17; 

  7
  -- 
  17


on rounded; 

4.5 quotient 2; 

  2.25 


quotient(x**2 + 3*x + 2,x+1); 

  X + 2 


matrix m,inverse; 

m := mat((a,b),(c,d)); 

  M(1,1) := A;
  M(1,2) := B;
  M(2,1) := C
  M(2,2) := D



inverse := quotient m; 

                      D
  INVERSE(1,1) := ----------
                  A*D - B*C
                        B
  INVERSE(1,2) := - ----------
                    A*D - B*C
                        C
  INVERSE(2,1) := - ----------
                    A*D - B*C
                      A
  INVERSE(2,2) := ----------
                  A*D - B*C

</TT></PRE><P><P>
<P>
The <em>quotient</em> operator is left associative: <em>a quotient b quotient c
</em> 
is equivalent to <em>(a quotient b) quotient c</em>. 
<P>
<P>
If a matrix argument to the unary <em>quotient</em> is not invertible, or if the
 
second matrix argument to the binary quotient is not invertible, an error 
message is given. 
<P>
<P>
<P>


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