blob: 1ed82e5d690765abc31dd3f45371a3bc12fb33d8 [file] [log] [blame]
<HTML>
<HEAD>
<TITLE>Constructive Reals Calculator</title>
</head>
<BODY BGCOLOR="#FFFFFF">
<H1>
Constructive Reals Calculator
</h1>
This is a slightly modified version of the constructive reals calculator
developed by Hans-J. Boehm at SGI. The copyright belongs to SGI.
Since it appears to no longer be available on the SGI site, it was rehosted
here, as allowed by its <A HREF="COPYRIGHT.txt">license</a>.
<P>
<NOSCRIPT>
Your browser does not support JavaScript, or it has been disabled.
Hence we cannot determine
the identity of the browser. You will need a browser with support for
at least Java 1.1 to correctly run the calculator Applet.
Netscape 4 or Internet Explorer version 4 or later should suffice.
To try to run the applet anyway, click
<A HREF="CRCalc-force.html">here</a>.
</noscript>
<SCRIPT language="javascript">
<!---
var navVersion = navigator.appVersion;
var navName = navigator.appName;
var goodBrowser = false;
var badBrowser = false;
document.open();
if (navName=="Netscape") {
if (navVersion >= "4.00") {
goodBrowser = true;
} else {
badBrowser = true;
}
}
if (navName=="Microsoft Internet Explorer") {
if (navVersion >= "4.0") {
goodBrowser = true;
} else {
badBrowser = true;
}
}
if (!goodBrowser) {
if (!badBrowser) {
document.write("Your " + navName + " web browser is not recognized. "
+ "The following applet requires at least Java 1.1 support. "
+ "If it does not function correctly, please upgrade your "
+ "browser, enable Java, or see <A HREF='download.html'>here</a> "
+ "for instructions on how to run it outside yout browser.");
document.write("<CENTER><APPLET code=CRCalc.class archive='classes.jar' "
+ "width=500 height=570 ALT='Failed to start Java applet'> </applet>"
+ "</center>");
} else {
document.write(
"The calculator applet requires at least Java 1.1 support. "
+ "You are running version " + navVersion + " of "
+ navName + ". "
+ "Please upgrade your browser to version 4 or later, "
+ "or see <A HREF='download.html'>here</a> "
+ "for instructions on how to run it outside your browser.");
}
} else {
if (navigator.javaEnabled()) {
document.write("<CENTER><APPLET code=CRCalc.class archive='classes.jar' "
+ "width=500 height=570 ALT='Failed to start Java applet'>");
// Navigator tends to do a much better job with the Dialog font
// than Courier. For some other browsers, Dialog has variable
// width.
if (navName == "Netscape") {
var os_name = navigator.platform.substr(0,3).toLowerCase();
if (os_name == "lin" || os_name == "iri") {
document.write("<PARAM NAME='font' VALUE='Dialog'>");
}
if (os_name == "lin" || os_name == "sol") {
// Netscape seems to get TextArea sizes right on Linux
// and probably Solaris. Thus we can leave off the extra
// padding on those.
document.write("<PARAM NAME='extra_rows' VALUE='0'>");
document.write("<PARAM NAME='extra_columns' VALUE='0'>");
}
} else {
// IE4 seems to get confused with no extra padding once
// the vertical scrollbar appears.
// It seems to do better with default padding.
}
document.write("</applet></center>");
} else {
document.write("Your browser supports Java, but it is disabled. "
+ "You will need to enable it to run the calculator applet. ");
if (navName == "Netscape") {
document.write("To enable java, try Edit->preferences->advanced. ");
}
}
}
document.write(
"<P> Click <A HREF='CRCalc-force.html'>here</a> to force your "
+ "browser to try to run the calculator in default mode "
+ "without browser testing. This may help if your "
+ "browser is misidentified, complains that it can't "
+ "find classes, or otherwise fails to run the above "
+ "applet correctly.");
document.close();
// -->
</script>
<H2>Overview</h2>
This is a calculator that operates on constructive real numbers.
Numbers are represented exactly internally to the calculator, and then
evaluated on demand to guarantee an error in the displayed result that
is strictly less than one in the least significant displayed digit.
It is possible to scroll the display to the right to generate
essentially arbitrary precision in the result.
<P>
The calculator uses reverse Polish notation. To add 1 and 2, either
click &lt;1&gt;&lt;enter&gt;&lt;2&gt;&lt;+&gt; on the calculator keypad,
or click on the
display, so that it receives keyboard input, and type 1&lt;space&gt;2+
on the keyboard. For more detailed instructions, click
<A HREF="instrs.html">here</a>.
<H2>Examples</h2>
Try e<SUP>PI &#183; sqrt(163)</sup>,
entered as 163 &lt;sqrt&gt; &lt;pi&gt; &lt;*&gt; &lt;exp&gt; .
<P>
To demonstrate the effect of demand-driven evaluation, try
<P>
123 &lt;+/-&gt; &lt;exp&gt; &lt;pi&gt; &lt;+&gt; &lt;ln&gt; &lt;exp&gt;
&lt;pi&gt; &lt;-&gt; &lt;ln&gt;.
<P>
or
<P>
10 &lt;enter&gt; 25 &lt;^&gt; &lt;atan&gt; &lt;tan&gt;
<H2>Library Interface</h1>
The calculator is implemented on top of a Java library that implements
constructive real arithmetic.
The library will live in com.sgi.math.
It provides two interesting classes:
<P>
<A HREF="CR.java">CR</a> provides constructive reals as a subclass
of <TT>Number</tt>. Its interface is described
<A HREF="com/sgi/math/CR.html">here</a>.
<P>
<A HREF="UnaryCRFunction.java">UnaryCRFunction</a>
provides some limited operations
on unary functions over the constructive reals. It also provides a large
number of constants for commonly used functions.
Its interface is described
<A HREF="com/sgi/math/UnaryCRFunction.html">here</a>.
<P>
Some general information on the implementation is <A HREF="impl.html">here</a>.
<P>
The entire calculator can be downloaded as a compressed tar file
<A HREF="download/CRCalc.tar.gz">here</a>.
<H2>Copyright</h2>
The calculator and library code is copyrighted by Silicon Graphics, Inc.
It may be used and redistributed subject to conditions specified
<A HREF="COPYRIGHT.txt">here</a> and in the source files.
<H2>Contact</h2>
Please send comments or questions to
<A HREF="mailto:Hans_Boehm@hp.com">Hans_Boehm@hp.com</a>.
<A HREF="../index.html">Hans Boehm's home page</a>.
</center>
</body>
</html>