Simple command line calculator http://amath.innolan.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

amath.1 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. .\" Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
  2. .\" All rights reserved.
  3. .\"
  4. .\" Redistribution and use in source and binary forms, with or without
  5. .\" modification, are permitted provided that the following conditions
  6. .\" are met:
  7. .\" 1. Redistributions of source code must retain the above copyright
  8. .\" notice, this list of conditions and the following disclaimer.
  9. .\" 2. Redistributions in binary form must reproduce the above copyright
  10. .\" notice, this list of conditions and the following disclaimer in the
  11. .\" documentation and/or other materials provided with the distribution.
  12. .\"
  13. .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  14. .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  15. .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  16. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  17. .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  18. .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  19. .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  20. .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21. .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  22. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. .TH amath 1 "Version 1.8.1" "April 22 2017"
  24. .SH NAME
  25. amath \- Simple command line calculator
  26. .SH SYNOPSIS
  27. \fC[ --noansi ] [ --shell | expression ]\fP
  28. .SH DESCRIPTION
  29. amath(1) features a case sensitive command line interface, internal
  30. IEEE 754 calculations with 15 significant digits, calculations with
  31. real and complex numbers, variables and user defined functions,
  32. logarithmic and exponential functions, trigonometric and hyperbolic
  33. function and selected mathematical constants and rounding functions.
  34. .SH Statements
  35. .nf
  36. clear Clear console window
  37. def Define function
  38. delete Delete variable or function
  39. digits Set number of significant digits
  40. eval Evaluate arithmetic expression
  41. execute Execute statements in a file
  42. functions Show list of user defined functions
  43. input Change numeral input system
  44. help Show basic help text
  45. output Change numeral output system
  46. list Show content of a directory
  47. show Show content of a file
  48. load Load variable and functions from file
  49. save Save variable and functions to file
  50. variables Show list of variables
  51. version Show version string
  52. memory Show internal memory usage
  53. exit Exit program
  54. .fi
  55. .SH Operators
  56. .nf
  57. + Mathematical addition
  58. - Mathematical subtraction
  59. * Mathematical multiplication
  60. / Mathematical division
  61. ^ Mathematical exponentiation
  62. = Assignment of variable values
  63. | Absolute value of number
  64. .SH Variables and constant
  65. .nf
  66. pi Trigonometric constant
  67. e Euler's number
  68. i Imaginary unit
  69. ins Result of last calculation
  70. .fi
  71. .SH Base functions
  72. .nf
  73. abs Absolute value of number
  74. sgn Mathematical signum function
  75. round Round to nearest integer number
  76. trunc Discard fraction part of number
  77. floor Mathematical floor function
  78. ceil Mathematical ceiling function
  79. sqrt Square root function (exp 1/2)
  80. cbrt Cube root function (exp 1/3)
  81. lb Binary logarithm function (base 2)
  82. ln Natural logarithm function (base e)
  83. lg Common logarithm function (base 10)
  84. .fi
  85. .SH Trigonometric functions
  86. .nf
  87. sin Trigonometric sine function
  88. cos Trigonometric cosine function
  89. tan Trigonometric tangent function
  90. cot Trigonometric cotangent function
  91. sec Trigonometric secant function
  92. csc Trigonometric cosecant function
  93. crd Trigonometric chord function
  94. exsec Trigonometric exsecant function
  95. excsc Trigonometric excosecant function
  96. arcsin Inverse trigonometric sine function
  97. arccos Inverse trigonometric cosine function
  98. arctan Inverse trigonometric tangent function
  99. arccot Inverse trigonometric cotangent function
  100. arcsec Inverse trigonometric secant function
  101. arccsc Inverse trigonometric cosecant function
  102. arccrd Inverse trigonometric chord function
  103. arcexsec Inverse trigonometric exsecant function
  104. arcexcsc Inverse trigonometric excosecant function
  105. .fi
  106. .SH Hyperbolic functions
  107. .nf
  108. sinh Hyperbolic sine function
  109. cosh Hyperbolic cosine function
  110. tanh Hyperbolic tangent function
  111. coth Hyperbolic cotangent function
  112. sech Hyperbolic secant function
  113. csch Hyperbolic cosecant function
  114. arcsinh Inverse hyperbolic sine function
  115. arccosh Inverse hyperbolic cosine function
  116. arctanh Inverse hyperbolic tangent function
  117. arccoth Inverse hyperbolic cotangent function
  118. arcsech Inverse hyperbolic secant function
  119. arccsch Inverse hyperbolic cosecant function
  120. .fi
  121. .SH Early trigonometric functions
  122. .nf
  123. ver Versed sine function
  124. vcs Versed cosine function
  125. cvs Coversed sine function
  126. cvc Coversed cosine function
  127. hv Haversed sine function
  128. hvc Haversed cosine function
  129. hcv Hacoversed sine function
  130. hcc Hacoversed cosine function
  131. arcver Inverse versed sine function
  132. arcvcs Inverse versed cosine function
  133. arccvs Inverse coversed sine function
  134. arccvc Inverse coversed cosine function
  135. archv Inverse haversed sine function
  136. archvc Inverse haversed cosine function
  137. archcv Inverse hacoversed sine function
  138. archcc Inverse hacoversed cosine function
  139. .fi
  140. .SH Example script
  141. .nf
  142. round(1.5461);round(-1.5461);
  143. ceil(43.5461);ceil(-43.5461);
  144. floor(39.9531);floor(-39.9531);
  145. trunc(23.827);trunc(-23.827);
  146. sqrt(100);sqrt(52.23);
  147. .fi
  148. .SH Example script with functions
  149. .nf
  150. f(x)=x*2+1;
  151. g(y)=y^2+y*1.5+2;
  152. a=2;b=3;c=a+b;
  153. vars;funcs;
  154. f(2.2);c+1.1;
  155. .fi
  156. .SH Example script with complex numbers
  157. .nf
  158. cos(1+2i);
  159. sin(1+2i);
  160. tan(1+2i);
  161. coth(1+2i);
  162. sech(1+2i);
  163. csch(1+2i);
  164. .fi
  165. .SH HOMEPAGE
  166. http://amath.innolan.net/
  167. .SH AUTHORS
  168. .PP
  169. Written by Carsten Sonne Larsen <cs@innolan.net>. The code in MemSet and
  170. MemCopy is derived from software contributed to Berkeley by Mike Hibler and
  171. Chris Torek. The code in complex calculations is derived from software
  172. written by Stephen L. Moshier.
  173. .SH COPYRIGHT
  174. Copyright (c) 2014-2017 Carsten Sonne Larsen <cs@innolan.net>
  175. .br
  176. Copyright (c) 1990, 1993 The Regents of the University of California
  177. .SH SEE ALSO
  178. amathc(3), amathr(3), amathi(3)