Home TRAINSCAN APPLICATIONS - WebScalp
Previous page Who What Where How When Translation, Traduction Editing Applications Contact Us

SHORT LINE: WebScalp is a web-based scientific calculator program. Your browser needs to have cookies enabled.

TRACKS:

Help

Overview

WebScalp (web-based scientific calculator program) is a stack-based calculator that uses Reverse Polish Notation (RPN). This was popularlized by Hewlett Packard on their scientific calculators introduced starting in the 1970s. Ads at the time stated that this type of caculator "had no equal" because indeed they were without an "=" button. The RPN system of operation was more efficient for long calculations than the normal calculator wth an equals button.

In short, numbers entered into an RPN calculator like WebScalp get pushed onto a stack. Mathematical operations take place on the last number or the last two numbers pushed onto the stack. To add two numbers together, say 3 and 4, one would first push 3 onto the stack, then push 4 onto the stack, and finally add them together:

3 4 +

WebScalp adds the two numbers, pops the stack, and the result ends up on the top. A more complicated example is:

DEG 45 COS 2 SQRT *

...which is the sequence to calculate the cosine of 45 degrees multiplied by the square root of 2. The DEG ensures that angles are measured in degrees. Many functions are spelled out in words rather than assigning them to arbitrary and non-standard symbols. Some functions have more than one command that invoke them. For example:

RECIP and RECIPROCAL

... both calculate the reciprocal. Note that upper and lower case are not significant for commands.

WebScalp displays the complete stack which is ten numbers deep. The top of the stack is Z -- that's where the answers appear. Deeper numbers on the stack are stored in Y, X and so on, all the way back through Q. There are also ten memory locations numbered M0 through M9 in which numbers can be stored for later retrieval and use.

Number entry

Numbers can be entered in fixed point:

e.g. 3.142857

Numbers can be entered in scientific notation:

e.g. 3e8 or -42e-22

Fixed point numbers can also use the suffixes "p" (pico; multiply by 10-9), "u" (micro; multiply by 10-6), "m" (milli; multiply by 10-3), "k" or "K" (kilo; multiply by 103), "M" (mega; multiply by 106), and "g" or "G" (giga; multiply by 109). Thus

3M

...produces 3000000.

Degrees, minutes, seconds (or hours, minutes, seconds) can be entered directly, separated by colons, as

30:32:22 for 30 degrees, 32 minutes, 22 seconds

...and they will be converted to decimal degrees (hours).

Polynomials

WebScalp can handle polynomials up to order 9 where the coefficients are stored in the memory locations M0 through M9. For example, f(z) = Az3 + Bz2 + Cz + D would be defined by the coefficients A, B, C, and D stored in memory locations M4 through M0. The coefficients can easily be entered on the stack and placed in memory. For example, the fourth-order polynomial F(z) = 2z3 + 9z2 + 4z + 1 can be defined using:

4 ORDER 2 9 4 1 POLYNOMIAL.

Assuming that the polynomial order has been set appropriately, then value of the polynomial for any value of Z can be evaluated using the command

F(Z).

The derivative of a defined polynomial for any value of Z can be calculated using

DF(Z).

A real root of a defined polynomial can be found by repeated applications of the

SOLVE

command, where Z is the initial estimate. This uses the Newton-Raphson method, one iteration per command. Different initial estimates and multiple uses of SOLVE may converge to different real roots where they exist. If no real root exists, repeated uses of SOLVE won't converge.

Date and Time

Webscalp can do limited manipulation of dates. A valid date is an integer of the form: yyyymmdd (year in four digits, month in two digits, and date in two digits). The command

TODAY CALENDAR

...will push the current date in valid format onto the top of the stack and display a three-month calendar with the current date highlighted. The calendar will remain as long as date manipulation commands are used.

Webscalp can also display the time as a four-digit integer (hhmm) using

NOW.

Note that the date and time are not necessarily local time of the user, but reflect the local time of the server where Webscalp is hosted.

Top of page


Listing of functions grouped by topic

Basic math:

+ - * / Y^Z Z^X RECIP SQR SQRT CHS ABS INT FRAC TAX TAX2


Trig and other math:

COS SIN TAN ACOS ASIN ATAN ATAN2 LN LOG EXP EXP10 MOD % DIST AZ POLAR RECT


Polynomials:

ORDER POLY F(Z) DF(Z) SOLVE QUADRATIC


Time and date:

NOW TODAY CAL

YR YEAR MON MONTH MOY

JULIAN DOY DOW

DDAY DDAYS DDATE DDATES

+D +M +W +Y

D+ M+ W+ Y+


Constants:

PI TWOPI

C G


Unit conversions:

KM_MI MI_KM M_FT FT_M

GIMP_L L_GIMP GUS_L L_GUS OZ_L L_OZ

KT_MPH MPH_KT KT_KPH KPH_KT

MPS_KPH KPH_MPS FPS_MPH MPH_FPS

OZ_GR GR_OZ LB_KG KG_LB

FT2_M2 M2_FT2 FT2_ACRE ACRE_FT2 M2_ACRE ACRE_M2

FT3_M3 M3_FT3 YD3_M3 M3_YD3

F_C C_F

DMS HMS

DB _DB

R_P P_R


Memory:

STOn STO+n STO-n STO*n STO/n RCLn


Stack Manipulation

CL CLS CLM CLA CLEAR SWAP PUSH POP


Settings and control:

RADS MILS DEGS LAT LONG LOWER UPPER MODULUS ORDER RESET EXIT HELP VER TAX1% TAX2%


Presentation:

LEFT CENTER CENTRE RIGHT FORMAT FLEX FIX DISPLAY INPUT


Top of page


Alphabetical listing of functions

_DB : decibels to ratio : units

- : minus : Z = Y - Z

! : factorial : Z = Z!

* : times : Z = Y * Z

/ : divide : Z = Y / Z

+ : plus : Z = Y + Z

+D : date plus day : Z = Y + Z where Y is valid date and Z is offset in days

+M : date plus week : Z = Y + Z where Y is valid date and Z is offset in months (actually 30 days)

+W : date plus week : Z = Y + Z where Y is valid date and Z is offset in weeks

+Y : date plus week : Z = Y + Z where Y is valid date and Z is offset in years (actually 365 days)

% : calculate modulus (residue) : Z = Z % Modulus

< : pop stack : Z = Y ; Y = X ; ... R = Q

> : push stack : Q = R ; R = S ; ...Y = Z

ABS : absolute value : Z = |Z|

ACOS : arc cosine : Z = acos(Z)

ACRE->FT2 : acres to square feet : units

ACRE_FT2 : acres to square feet : units

ACRE->M2 : acres to square metres : units

ACRE_M2 : acres to square metres : units

ASIN : arc sine : Z = asin(Z)

ATAN : arc tangent : Z = atan(Z)

ATAN2 : 4 quadrant arc tan : Z = atan(Z/Y)

AZ : calculate azimuth of bearing from one point to another : Z = azimuth, assuming points have been pushed onto stack in order x1, y1, x2, y2

AZIMUTH : calculate azimuth of bearing from one point to another : Z = azimuth, assuming points have been pushed onto stack in order x1, y1, x2, y2

C : c : speed of light, metres/second

C->F : degrees C to degrees F : units

C_F : degrees C to degrees F : units

CAL : calendar : calendar of Z if it's a valid date

CENTER : center display of Z : presentation

CENTRE : centre display of Z : presentation

CHS : change sign : Z = -1 * Z

CL : clear Z : Z = 0

CLA : clear all stack and memory : Z=Y=...Q = 0 ; M0=M1=...M9 = 0

CLEAR : clear all stack and memory : Z=Y=...Q = 0 ; M0=M1=...M9 = 0

CLM : clear memory : M0=M1=...M9 = 0

CLS : clear stack : Z=Y=...Q = 0

COS : cosine : Z = cos(Z)

D+ : date plus day : Z = Y + Z where Y is valid date and Z is offset in days

DB : ratio to decibels : units

DDAY : difference in days : Z = days between date in Z and date in Y assuming they both contain valid date

DDAYS : difference in days : Z = days between date in Z and date in Y assuming they both contain valid date

DDATE : difference in days : Z = days between date in Z and date in Y assuming they both contain valid date

DDATES : difference in days : Z = days between date in Z and date in Y assuming they both contain valid date

DEG : assume angles are in degrees : setting

DEGREE : assume angles are in degrees : setting

DEGREES : assume angles are in degrees : setting

DF(X) : calculate derivative of polynomial function : Z = F'(Z)

DF(Z) : calculate derivative of polynomial function : Z = F'(Z)

DFX : calculate derivative of polynomial function : Z = F'(Z)

DFZ : calculate derivative of polynomial function : Z = F'(Z)

DISPLAY : diplay type, depending on Z : text if Z=0; small graphics if Z=1; large graphics if Z=2

DIST : calculate distance between two points : Z = distance, assuming points have been pushed onto stack in order x1, y1, x2, y2

DISTANCE : calculate distance between two points : Z = distance, assuming points have been pushed onto stack in order x1, y1, x2, y2

DMS : show degrees:minutes:seconds from decimal degrees in Z : units

DONE : exit program : control

DOW : day of week : Z = day(Z) 1..7 (Sunday..Sat) if Z contains valid date

DOY : day of year : Z = day(Z) 1..366 if Z contains valid date

EXIT : exit program : control

EXP : natural exponential : Z = e^Z

EXP10 : base 10 exponential : Z = 10^Z

F->C : degrees F to degrees C : units

F_C : degrees F to degrees C : units

F(X) : calculate polynomial function : Z = F(Z)

F(Z) : calculate polynomial function : Z = F(Z)

FACT : factorial : Z = Z!

FACTORIAL : factorial : Z = Z!

FIX : fixed point display : setting

FIXED : fixed point display : setting

FLEX : flexible display format : setting

FLEXIBLE : flexible display format : setting

FORMAT : set fixed diplay format width.decimals : setting

FPS->MPH : feet per second to miles per hour : units

FPS_MPH : feet per second to miles per hour : units

FRAC : fractional portion : Z = Z - int(Z)

FT->M : feet to metres : units

FT_M : feet to metres : units

FT2->ACRE : square feet to acres : units

FT2_ACRE : square feet to acres : units

FT2->M2 : square feet to square metres : units

FT2_M2 : square feet to square metres : units

FT3->M3 : cubic feet to cubic metres : units

FT3_M3 : cubic feet to cubic metres : units

FX : calculate polynomial function : Z = F(Z)

FZ : calculate polynomial function : Z = F(Z)

G : g : gravitational constant, m/second2

GIMP->L : imperial gallons to litres : units

GIMP_L : imperial gallons to litres : units

GR->OZ : grams to ounces : units

GR_OZ : grams to ounces : units

GST : calculate tax 1 : Y = Z; Z = tax1(Z)

GST% : set tax rate 1 : Tax1 = Z

GUS->L : US gallons to litres : units

GUS_L : US gallons to litres : units

HELP : display help file : control

HMS : show hours:minutes:seconds from decimal hours in Z : units

INPUT : size of command line space, depending on Z : if Z is 1 or less, single command line; otherwise Z lines to a maximum of 20

INT : integer portion : Z = int(Z)

JULIAN : day of year : Z = day(Z) 1..366 if Z contains valid date

KG->LB : kilograms to pounds : units

KG->LB : kilograms to pounds : units

KM->MI : kilometres to miles : units

KM_MI : kilometres to miles : units

KPH->KT : kilometres per hour to knots : units

KPH_KT : kilometres per hour to knots : units

KT->KPH : knots to kilometres per hour : units

KT_KPH : knots to kilometres per hour : units

KT->MPH : knots to miles per hour : units

KT_MPH : knots to miles per hour : units

L->GIMP : litres to imperial gallons : units

L_GIMP : litres to imperial gallons : units

L->GUS : litres to US gallons : units

L_GUS : litres to US gallons : units

L->OZ : litres to fluid ounces : units

L_OZ : litres to fluid ounces : units

LAT : set latitude : Latitude = Z (not currently used by any function)

LATITUDE : set latitude : Latitude = Z (not currently used by any function)

LB->KG : pounds to kilograms : units

LB_KG : pounds to kilograms : units

LEFT : left justify display of Z : presentation

LN : natural log : Z = ln(Z)

LOG : base 10 log : Z = log10(Z)

LONG : set longitude : Longitude = Z (not currently used by any function)

LONGITUDE : set longitude : Longitude = Z (not currently used by any function)

LOWER : set lower limit for fixed point presentation (anything smaller than this value is not shown in fixed point) : presentation

M+ : date plus week : Z = Y + Z where Y is valid date and Z is offset in months (actually 30 days)

M->FT : metres to feet : units

M_FT : metres to feet : units

M2->ACRE : square metres to acres : units

M2_ACRE : square metres to acres : units

M2->FT2 : square metres to square feet : units

M2_FT2 : square metres to square feet : units

M3->FT3 : cubic metres to cubic feet : units

M3_FT3 : cubic metres to cubic feet : units

M3->YD3 : cubic metres to cubic yards : units

M3_YD3 : cubic metres to cubic yards : units

MI->KM : miles to kilometres : units

MI_KM : miles to kilometres : units

MIL : assume angles are in mils : setting

MILS : assume angles are in mils : setting

MOD : calculate modulus (residue) : Z = Z % Modulus

MODULUS : set modulus : Modulus = Z

MON : month : Z = month(Z) 1..12 if Z contains valid date

MONTH : month : Z = month(Z) 1..12 if Z contains valid date

MOY : month of year : Z = month(Z) 1..12 if Z contains valid date

MPH->FPS : miles per hour to feet per second : units

MPH_FPS : miles per hour to feet per second : units

MPH->KT : miles per hour to knots : units

MPH_KT : miles per hour to knots : units

NOW : current time : Z = hhhhmm

ORDER : set polynomial order : order = Z

OZ->GR : ounces to grams : units

OZ_GR : ounces to grams : units

OZ->L : fluid ounces to litres : units

OZ_L : fluid ounces to litres : units

P_R : convert polar to rectangular coordinates : Z = y-coord, Y = x-coord, assuming that Y=magnitude, Z=argument

PI : pi : Z = 3.14...

POLAR : convert rectangular to polar coordinates : Z = magnitude, Y = argument, assuming that Y=x-coord, Z=y-coord

POLY : define polynomial : copy stack to memory to define the coefficients of a polynomial to level defined by ORDER, i.e. Mem[0] = Z, Mem[1] = Y... Mem[order]

POLYNOMIAL : define polynomial : copy stack to memory to define the coefficients of a polynomial to level defined by ORDER i.e. Mem[0] = Z, Mem[1] = Y... Mem[order]

POP : pop stack : Z = Y ; Y = X ; ... R = Q

PST : calculate tax 2 : Y = Z; Z = tax2(Z)

PST2% : set tax rate 2 : Tax2 = Z

PUSH : push stack : Q = R ; R = S ; ...Y = Z

QUAD : calculate real roots of a second-order polynomial using quadratic equation : Z = first real root, second one displayed if it exists

QUADRATIC : calculate real roots of a second-order polynomial using quadratic equation : Z = first real root, second one displayed if it exists

R_P : convert rectangular to polar coordinates : Z = magnitude, Y = argument, assuming that Y=x-coord, Z=y-coord

RAD : assume angles are in radians : setting

RADIANS : assume angles are in radians : setting

RADS : assume angles are in radians : setting

RCLn : recall from memory : Z = Mem[n]

RECIP : reciprocal : Z = 1/Z

RECIPROCAL : reciprocal : Z = 1/Z

RECT : convert polar to rectangular coordinates : Z = y-coord, Y = x-coord, assuming that Y=magnitude, Z=argument

RECTANGULAR : convert polar to rectangular coordinates : Z = y-coord, Y = x-coord, assuming that Y=magnitude, Z=argument

RESET : reset all settings to defaults : setting

RIGHT : right justify display of Z : presentation

SIN : sine : Z = sin(Z)

SOLVE : calculate one Newton-Raphson iteration to solve polynomial function : Z = Z - F(Z) / F'(Z)

SQR : square : Z = Z*Z

SQRT : square root : Z = sqrt(Z)

STO-n : subtract from memory : Mem[n] = Mem[n] - Z

STO*n : multiply by memory : Mem[n] = Mem[n] * Z

STO/n : divide into memory : Mem[n] = Mem[n] / Z

STO+n : add to memory : Mem[n] = Mem[n] + Z

STOn : store to memory : Mem[n] = Z

SWAP : swap bottom two elements of stack : Z = Y ; Y = Z

TAN : tangent : Z = tan(Z)

TAX : calculate tax 1 : Y = Z; Z = tax1(Z)

TAX1 : calculate tax 1 : Y = Z; Z = tax1(Z)

TAX2 : calculate tax 2 : Y = Z; Z = tax2(Z)

TAX% : set tax rate 1 : Tax1 = Z

TAX1% : set tax rate 1 : Tax1 = Z

TAX2% : set tax rate 2 : Tax2 = Z

TODAY : current date : Z = yyyymmdd

TWOPI : pi times two : Z = 6.28...

UPPER : set upper limit for fixed point presentation (anything larger than this value is not shown in fixed point) : presentation

VAT : calculate tax 1 : Y = Z; Z = tax1(Z)

VAT% : set tax rate 1 : Tax1 = Z

VER : display software version : control

VERSION : display software version : control

W+ : date plus week : Z = Y + Z where Y is valid date and Z is offset in weeks

Y^Z : power : Z = Y ^ Z

Y+ : date plus week : Z = Y + Z where Y is valid date and Z is offset in years (actually 365 days)

YD3->M3 : cubic yards to cubic metres : units

YD3_M3 : cubic yards to cubic metres : units

YEAR : year : Z = year(Z) if Z contains valid date

YR : year : Z = year(Z) if Z contains valid date

Z^Y : power : Z = Z ^ Y

Top of page

This page was last updated 20080119. Copyright (C) 2008 Timothy Green. All rights reserved.