Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7ebd25ac536d248d499a3ce2acda963a > files > 3881

Macaulay2-1.3.1-8.fc15.i686.rpm

<?xml version="1.0" encoding="utf-8" ?>  <!-- for emacs: -*- coding: utf-8 -*- -->
<!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"	 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>Thing === Thing -- strict equality</title>
<link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/>
</head>
<body>
<table class="buttons">
  <tr>
    <td><div><a href="__eq!_eq.html">next</a> | <a href="_!_eq.html">previous</a> | <a href="__eq!_eq.html">forward</a> | <a href="_!_eq.html">backward</a> | <a href="_operators.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div>

    </td>
  </tr>
</table>
<div><a href="index.html" title="">Macaulay2Doc</a> > <a href="___The_sp__Macaulay2_splanguage.html" title="">The Macaulay2 language</a> > <a href="_operators.html" title="">operators</a> > <a href="___Thing_sp_eq_eq_eq_sp__Thing.html" title="strict equality">Thing === Thing</a></div>
<hr/>
<div><h1>Thing === Thing -- strict equality</h1>
<div class="single"><h2>Synopsis</h2>
<ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>x === y</tt></div>
</dd></dl>
</div>
</li>
<li><span>Operator: <a href="___Thing_sp_eq_eq_eq_sp__Thing.html" title="strict equality">===</a></span></li>
<li><div class="single">Inputs:<ul><li><span><tt>x</tt>, <span>a <a href="___Thing.html">thing</a></span></span></li>
<li><span><tt>y</tt>, <span>a <a href="___Thing.html">thing</a></span></span></li>
</ul>
</div>
</li>
<li><div class="single">Outputs:<ul><li><span><span>a <a href="___Boolean.html">Boolean value</a></span>, whether the expressions <tt>x</tt> and <tt>y</tt> are strictly equal</span></li>
</ul>
</div>
</li>
</ul>
</div>
<div class="single"><h2>Description</h2>
<div><p>Strictly equal expressions have the same type, so <tt>0===0.</tt> and <tt>0===0/1</tt> are false; the three types involved here are <a href="___Z__Z.html" title="the class of all integers">ZZ</a>, <a href="___R__R.html" title="the class of all real numbers">RR</a>, and <a href="___Q__Q.html" title="the class of all rational numbers">QQ</a>.</p>
<p>If x and y are <a href="_mutable.html" title="whether something may be modified">mutable</a> then they are strictly equal only if they are identical (i.e., at the same address in memory).  For details about why strict equality cannot depend on the contents of mutable hash tables, see <a href="_hashing.html" title="">hashing</a>.  On the other hand, if x and y are non-mutable, then they are strictly equal if and only if all their contents are strictly equal.</p>
<table class="examples"><tr><td><pre>i1 : {1,2,3} === {1,2,3}

o1 = true</pre>
</td></tr>
<tr><td><pre>i2 : {1,2,3} === {2,1,3}

o2 = false</pre>
</td></tr>
</table>
<p>For some types, such as ring elements and matrices, strict equality is the same as mathematical equality.  This tends to be the case for objects for which not much computation is not required to test equality.  For certain other types, such as <a href="___Ideal.html" title="the class of all ideals">Ideal</a> or <a href="___Module.html" title="the class of all modules">Module</a>, where extensive computations may be required, the operator <a href="__eq_eq.html" title="equality">==</a> implements the desired comparison.</p>
<table class="examples"><tr><td><pre>i3 : R = QQ[a..d];</pre>
</td></tr>
<tr><td><pre>i4 : a^2+b === b+a^2

o4 = true</pre>
</td></tr>
<tr><td><pre>i5 : ideal(a^2+b,c*d) === ideal(b+a^2,c*d+b+a^2)

o5 = false</pre>
</td></tr>
<tr><td><pre>i6 : matrix{{a,b,c}} === matrix{{a,b,c}}

o6 = true</pre>
</td></tr>
<tr><td><pre>i7 : matrix{{a,b,c}} === transpose matrix{{a},{b},{c}}

o7 = false</pre>
</td></tr>
</table>
<p>As it happens, polynomial rings are mutable objects, and new ones are easily created, which are distinct from each other.  For example, the rings <tt>A</tt> and <tt>B</tt> below are not strictly equal.</p>
<table class="examples"><tr><td><pre>i8 : A = QQ[x]; B = QQ[x];</pre>
</td></tr>
<tr><td><pre>i10 : A === B

o10 = false</pre>
</td></tr>
</table>
</div>
</div>
<div class="single"><h2>See also</h2>
<ul><li><span><a href="__eq_eq.html" title="equality">==</a> -- equality</span></li>
<li><span><a href="__eq!_eq.html" title="strict inequality">=!=</a> -- strict inequality</span></li>
<li><span><a href="_operators.html" title="">operators</a></span></li>
</ul>
</div>
</div>
</body>
</html>