Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

ACalc.exe (Miscellaneous)

posted by Doug(R) E-mail, 05.11.2011, 07:16

> - a simple calculator for DOS?

I've been using the command-line ACALC.EXE for ages. It's from IBM PC-DOS 7.0/2000. The updated version with a fix is available here:

ftp://ftp.software.ibm.com/ps/products/pcdos/fixes/v7.0/d70acalc.zip

Here's the /? help:

ACALC [/T[:]format] expression

  /T           Specifies the output format type
  format         D=Decimal (default)  B=Binary  O=Octal  X=heXadecimal
                 A=All (decimal, binary, octal, and hexadecimal)
  expression   Specifies a valid numeric expression.

Numbers prefixed with 'b', 'o', and 'x' are assumed to be binary, octal,
and hexadecimal respectively.  Decimal numbers are not prefixed.

Arithmetic Operators:              Bitwise Operators:
  ()  Separators                     &   Bitwise AND
  *   Multiplication                 :   Bitwise OR
  /   Division                       ^   Bitwise XOR
  %   Modulo (remainder of x/y)      {   Left Shift
  +   Addition                       }   Right Shift
  -   Subtraction

General Math Functions:
  ABS(x)     Absolute Value of x
  EXP(x)     Exponential of x
  FACT(x)    Factorial of x (a positive number less than 21)
  LOG(x)     Natural Logarithm of x (a positive number)
  LOG10(x)   Logarithm of x (a positive number) to the Base 10
  MAX(x;y)   Larger of the two values x and y
  MIN(x;y)   Smaller of the two values x and y
  PI()       Value of Pi (3.14159265359)
  POW(x;y)   x raised to the power of y
  SQRT(x)    Square Root of x (a positive number)

Trigonometric Math Functions:
  COS(x)     Cosine of the Angle x in Radians
  SIN(x)     Sine of the Angle x in Radians
  TAN(x)     Tangent of the Angle x in Radians

Example: ACALC FACT(((8+1)/2)*2-SQRT(MAX(6;3)))

- Doug B.

 

Complete thread:

Back to the forum
Board view  Mix view
15112 Postings in 1359 Threads, 247 registered users, 11 users online (0 registered, 11 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum