AminetAminet
Search:
84040 packages online
About
Recent
Browse
Search
Upload
Setup
Services

misc/math/Compute.lha

Mirror:Random
Showing:m68k-amigaosppc-amigaosppc-morphosi386-arosi386-amithlonppc-warpupppc-powerupgeneric
No screenshot available
Short:Command line calculator
Author:thomas.richter at alumni.tu-berlin.de (Thomas Richter)
Uploader:thomas richter alumni tu-berlin de (Thomas Richter)
Type:misc/math
Version:45.2
Architecture:m68k-amigaos >= 2.0
Date:2022-02-16
Download:http://aminet.net/misc/math/Compute.lha - View contents
Readme:http://aminet.net/misc/math/Compute.readme
Downloads:889

---------------------------------------------------------------------------

About Compute:

"Compute" is a minimalistic and short command line calculator/expression
evaluator that performs floating point math. For example,

1> Compute 2+2
+4

will compute two plus two. 

("1>" stands for the shell prompt, it is not part of your input).


"Compute" respects operator priorities, such as

1> Compute 2+3*4
+14

that is, multiplication is performed first, as it should. Compute
also implements all transcendental functions the operating system
math libraries provide. The following functions are available:

atan(x)	:	computes the arcus tangent of its argument in radiants
sin(x)	:	computes the sine of x, x is in radiants
cos(x)	:	computes the cosine of x, x is in radiants
tan(x)	:	computes the tangent of x, x is in radiants
sinh(x)	:	computes the hyperbolic sine of x
cosh(x)	:	computes the hyperbolic cosine of x
tanh(x)	:	computes the hyperbolic tangent of x
exp(x)	:	computes exponential function of x, namely e^x
log(x)	:	computes the natural logarithm (to the base of e) of x
ln(x)	:	identical to log(x), the natural logartihm
sqrt(x)	:	computes the square root of x
root(x)	:	identical to sqrt(x), the square root
asin(x)	:	computes the arcus sine of its argument in radiants
acos(x)	:	computes the arcus cosine of its argument in radiants
log10(x):	computes the logarithm to the base of 10
lg(x)	:	identical to log10(x)
x^y	:	raises x to the power of y
    
---------------------------------------------------------------------------

Background:

"Compute" is a short trivial program I wrote in 2000 to test the Os 3.9
and later Os 3.1.4 math libraries. It is more a test program for the math
libraries than anything else. Since it may be useful for other purposes, and
is also extremely tiny, I decided to publish it.

Since "Compute" was designed as a test program, it is included in three
versions:

Compute:	The default version uses the double precision IEEE format
		and tests the mathieeedoubbas and mathieeedoubtrans
		libraries.

Compute_Single:	This version uses the single precision IEEE format and as
		such tests the mathieeesingbas and mathieeesingtrans
		libraries.

Compute_FFP:	This version uses the Motorola FFP (fast floating point)
		format and thus tests the mathffp and mathtrans libraries.

Note that FFP (and thus mathtrans) have a couple of known issues due to the
simplicity of the format. FFP cannot represent infinities and NANs 
(not-a-number) whereas the IEEE versions can. This may result in some
numerical instabilities and defects that are due to the format.

"Compute" uses its own conversion functions between floating point formats 
and decimal input/output, it does not depend on the compiler version. These
functions attempt to maximize precision, they do not attempt to generate
nice looking results. That is, no "optical rounding" is performed. Outputs
may show as +INF/-INF (for infinities), signed zeros (-0) or "NAN", which
stands for "Not-A-Number", indicating that a function failed. For example:

1> Compute 0/0
+NAN

---------------------------------------------------------------------------

Changes made for release 45.2:

	The 45.1 release closed the math base library twice. This was
	fixed in the 45.2 version.

---------------------------------------------------------------------------

History:

Changes made for release 45.1:

	This is the first Aminet release. Note that the program is quite
	old (see the output of the "version" program on "Compute").

-----------------------------------------------------------------------------

                      The THOR-Software Licence (v3, January 2nd 2021)

This License applies to the computer programs known as "Compute", 
"Compute_FFP" and "Compute_Single". The "Program", below, refers to such 
program. The "Archive" refers to the package of distribution, as prepared by 
the author of the Program, Thomas Richter. Each licensee is addressed as "you".

The Program and the data in the archive are freely distributable
under the restrictions stated below, but are also Copyright (c)
Thomas Richter.

Distribution of the Program, the Archive and the data in the Archive by a
commercial organization without written permission from the author to any
third party is prohibited if any payment is made in connection with such
distribution, whether directly (as in payment for a copy of the Program) or
indirectly (as in payment for some service related to the Program, or
payment for some product or service that includes a copy of the Program
"without charge"; these are only examples, and not an exhaustive
enumeration of prohibited activities).


However, the following methods of distribution involving payment shall not
in and of themselves be a violation of this restriction:
(i) Distributing the Program on a physical data carrier (e.g. CD-ROM,
    DVD, USB-Stick, Disk...) provided that:

a) the Archive is reproduced entirely and verbatim on such data carrier,
   including especially this licence agreement;

b) the data carrier is made available to the public for a nominal
   fee only, i.e. for a fee that covers the costs of the data carrier,
   and shipment of the data carrier;

c) a data carrier with the Program installed is made available to the
   author for free except for shipment costs, and

d) provided further that all information on said data carrier is
   redistributable for non-commercial purposes without charge.


Redistribution of a modified version of the Archive, the Program or the
contents of the Archive is prohibited in any way, by any organization,
regardless whether commercial or non-commercial. Everything must be kept
together, in original and unmodified form.



Limitations.


THE PROGRAM IS PROVIDED TO YOU "AS IS", WITHOUT WARRANTY. THERE IS NO
WARRANTY FOR THE PROGRAM, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE
RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD
THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
SERVICING, REPAIR OR CORRECTION.


IF YOU DO NOT ACCEPT THIS LICENCE, YOU MUST DELETE THE PROGRAM, THE ARCHIVE
AND ALL DATA OF THIS ARCHIVE FROM YOUR STORAGE SYSTEM. YOU ACCEPT THIS
LICENCE BY USING OR REDISTRIBUTING THE PROGRAM.

-----------------------------------------------------------------------------

Send ideas, improvements, bugreports (please as concrete as possible) to:


        Thomas Richter


EMail:  thomas.richter at alumni.tu-berlin.de
______________________________________________________________________________

February 2022
        Thomas


Contents of misc/math/Compute.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
[unknown]                  281     628  44.7% -lh5- 7c76 Jan 22 12:16 Compute.info
[unknown]                 2570    3932  65.4% -lh5- b179 Feb 16 19:28 Compute/Compute
[unknown]                 2913    7014  41.5% -lh5- 2352 Feb 16 19:30 Compute/Compute.readme
[unknown]                 2483    3748  66.2% -lh5- 7ca3 Feb 16 19:22 Compute/Compute_FFP
[unknown]                 2512    3796  66.2% -lh5- 829b Feb 16 19:27 Compute/Compute_Single
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total         5 files   10759   19118  56.3%            Feb 17 04:41

Aminet © 1992-2023 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>