CompCalc Version 1.0
©2004-2009, Bradley K. Goodman, All Rights Reserved

Check Online Errata

CompCalc Reference

The Basics

Lines typed in the command line (bottom) are sent the bottom of the display area - similar to how entries typed into an adding machine are added to the end of an adding machine tape. After a line is entered the new "total" is placed in the display area.

The keyboard can be scrolled left to right to reveal more keys. Typically, hexidecimal and bitwise keys are to the left, and trigonamatric keys are to the right.

Expressions are entered, followed by the "Enter" key. Both your entry, and the result (preceded by an Equal-Sign "=") are displayed in teh Result view. Each line entered can be a value/number, an expression, or a continuation of the previous running "total" on the "tape". For example:


Continuation-Type Entry


Expression-Type Entry

The variable "ans" can be used to reference the preceding "answer" on the display. For example:


Using "ANS"

Numerical Entry

Values may be entered in one of several different ways:

  • Standard numbers - such as "22", "33.43" or "-12.33"
  • Hexidecimal numbers must be preceded by a "0x". For example "0x300".
  • Scientific Notation - such as "12e-6".
  • Engineering Notation - using engineering notation symbols (See "Engineering Base" below) such as "1k" or "100M".
  • Values may be entered through the standard CompCalc keypad, or if desired, through the the normal "keyboard" interface, by clicking on the entry field. When entering through the keyboard, different symbols may be needed to represent various operations. When using the keypad, these symbols are added for you. For example, when pressing the "Multiply" key on the keypad, an asterisk ("*") is entered into the entry field.

    Standard Operators

    Arithmetic Operators

  • + Addition
  • - Minus
  • * Times
  • / Divide
  • # Remainder
  • ^ Power
  • @ Root
  • E Power-10
  • % Percent
  • Boolean Operators

  • & Bitwise-And
  • | Bitwise-Or
  • _ Bitwise-XOr
  • < Bit Shift Left
  • > Bit Shift Right
  • ~ Not
  • Modes of Operation

    There are various modes that BKGcalc can run it to affect its operation. The current settings of the modes are displayed directly below the blue horizontal line. They are as folows:

    Modes
    Angle Mode Degrees or Radians Describes what the values in trigonometric functions will be expressed in
    Display Mode Sci, Eng, Dec or Hex Describes the format used to display data
    Engineering Base Comp or Norm Describes base (1000 or 104) for engineering notation

    You can enter the commands "dec" or "rad" to switch modes, but they are more commonly (and easily) accessed via. the "Mode" window, by tapping the "mode" button on the bottom toolbar. The Mode window appears as follows:


    Mode Window

    Note that switching modes has no affect on the current values on the display. To convert numbers between degrees and radians, use the todeg() and torad() functions.

    Angle Mode

    Angle mode defines the type of units that will be bot used and returned for trigonometric functions.

    dec - Trig functions are DEGREES
    rad - Trig functions are RADIANS

    Display Modes

    The Display Mode defines how numerical data will be displayed it can be changed at any time by entering the following commands:

  • hex - Display in base 16
  • dec - Display in base 10
  • sci - Display in scientific notation
  • eng - Engineering Notation (See "Engineering Base" below)
  • After changing to one of these modes, the preceding answer in the display is re-displayed in the new mode. For example:


    Display Modes

    Engineering Base

    This feature is my personal favorite - and I could be wrong - but know of no other calculators that do it!

    BKGcalc will take input, and display out (when in "eng" mode) using some of the standard numerical suffixes - i.e. "k" for 1000, "M" for 1000000, etc. This often makes things more ledgible, and easier to type.

    However - in the world of computers "k" isn't 1000 - it's 1024 and "M" isn't 1000000 - it's 1048576 (1024*1024), etc. So to make life a bit easier in doing computer-work "comp" mode treats these suffixes - in both display and data entry as 1024-based - not the usual 1000-based. So these symbols have meanings which depend on the mode you're in:

    Norm Comp
    n (nano) 10-9 2-30
    u (micro) 10-6 2-20
    m (milli) 10-3 2-10
    k (kilo) 1000 or 103 1024 or 210
    M (Mega) 1,000,000 or 106 1,048,576 or (1024×1024) or 220
    G (Giga) 1,000,000,000 or 109 (1024×1024×1024) or 230
    T (Terra) 1,000,000,000,000 or 1012 10244 or 240

    Here is a little example:


    Engineering Base and Display Modes

    More on Display Modes

    It is importiant to note that I have "decoupled" the display modes from the act of inputting a number as much as possible. This allows one to enter values one way, display them another, and change the display at will.

    For example - one can be in decimal mode - and enter data in hex, or vica-versa.


    Input and Display Modes

    Not this only applies for "Display Mode" - and not "Engineering Base" or "Angle Modes" which are applicable for both entry and display.

    Variables

    The six letter keys on the left of the keypad A-F can be used for variable assignments. These variables can be assigned with the "equals" (=) key, and used in any normal expression.
    Example:

    A=123
      123.
    B=200.
      200.
    A*B
      24600.
    

    Variables are retained each time you exit/relaunch CompCalc.

    Input Buttons

    There are other buttons which can be used to help with input. These are to the immediate right of the entry field, and are the "history" and "clear entry" buttons.


    History and Clear Buttons

    Clear Entry

    The "clear entry" button is the red button to the immediate left of the input field. Clicking it, will clear the contents of the entry field alone. To clear the contents of both the entry and result field, click the "Clear" button in the toolbar.

    History

    The blue "history" button can be used to quickly re-enter both old entries or results into the input field. This is especially usefuly for going back and correcting mistakes, or as a quick way to re-used results from previous calculations. Clicking the "history" button will bring up a picker which contains the contents of the results window. Scrolling back and selecting a line, then pressing "add" will place the contents of the section in the input field.


    History Picker

    Constants and Units

    The "Units" button on the toolbar can be used to access all the engineering-notation suffixes, and certian pre-defined constants. Pressing it, will give you a window as follows:


    Units and Constants Window

    Functions

    Functions may be preformed in the general way, of entering the function-name, followed by a term, for example:

    cos 45

    The first term will be used as the function parameter. If more than one term is desired, parenthesis must be used. For example:

    cos 45
    =.707
    cos 45+1
    = 1.707
    cos (22+23)
    = .707

    ans

    Previous answer. e.g.:
    2+2
    =4
    1/ans
    =.25
    

    log

    In version 1,1

    Compute Base-10 Log

    Example:

    	log(100) returns 2
    	

    ln

    In version 1,1

    Compute Natural Log

    Example:

    	ln(20) returns 2.995732273553991
    	

    cos(θ)

    Returns cosine of αtheta; in specified Angle Mode units

    Example:

    cos(45) returns 0.707...
    

    sin(θ)

    Returns sine of αtheta; in specified Angle Mode units

    Example:

    sin(30) returns 0.5
    

    tan(θ)

    Returns tangent of αtheta; in specified Angle Mode units

    Example:

    tan(30) returns 0.577..
    

    acos(χ)

    Returns arccosine of χ in specified Angle Mode units

    asin(χ)

    Returns arcsine of χ in specified Angle Mode units

    atan(χ)

    Returns arctangent of χ in specified Angle Mode units

    pi

    Returns value of π

    torad(θ)

    Converts θ degrees to radians - returns result

    todeg(θ)

    Converts θ radians to degrees - returns result

    sqrt(χ)

    Returns square root of χ


    ©2006-2009 Bradley K. Goodman, All Rights Reserved
    compcalc@bradgoodman.com