Back to MiscEl main page | Write a message to author |

A calculator with many functions and the ability to draw curves and make tables.

A valid expression could be:

`3*4`

or

`sin(pi/17)*power(3,2.3)/(1+cosh(4))`

To store a result for later use:

`var a;`

`a:=3*4`

Or create a permanent variable with:

`a`

, then right click and select "Create variable", this variable is stored and will last
until deleted (starting/stopping the MiscEl program will not delete the variable or the value)Right click for more options:

- Result to clipboard, copy the result to the clipboard for use elsewhere
- Add to statements, copy the line to the "Statements page"
- Create variable, create a permanent variable, as described above
- Create function, create a permanent function, see description under "Functions" page

- Result to clipboard, copy the result to the clipboard for use elsewhere
- Add to statements, copy the line to the "Statements page"
- Delete, remove the line

Right click for more options:

- Move up/down, change the execute sequence of the statements
- Result to clipboard, copy the result to the clipboard for use elsewhere
- Add, add current edit line to statments
- Delete entry, remove the line
- Save, save the statements to a file
- Load, load the statements from a file

`free("name")`

).Global variables can be used anywhere in MiscEl, but the pages will NOT update automatic when a variable is changed (Add or delete a space in a input field to update)! Right click for more options:

- Result to clipboard, copy the contens of the variable to the clipboard for use elsewhere
- Set value, assign the last result from the editing line to the variable
- Del var, remove the global variable

`functionname=expression`

in the editing line, then right click and select "Create function".
All parameters passed to the function can be accessed in the "param" array, first parameter as index 0.An example (Two resistor in parallel):

`par=1./(1./param[0]+1./param[1])`

Use the function by writing:

`par(10k,30k)`

The function can contain more than one statement, use

`;`

as a delimeter. It is also possible to define variables with the `var`

statement, these variables are local, and not saved between invocations of the function.Functions can be used anywhere in MiscEl.

Double click to copy the function to the editing line

Right click for more options:

- Result to clipboard, copy the result to the clipboard for use elsewhere
- Add, define current editing line as a function
- Del, remove the selected function

- Name of the constant
- Symbol or name that can be used in MiscEl
- Value of the constant, this value is displayed according to the selected numerical display format
- Unit

Right click for more options:

- Use, same as a doubleclick, copy the constant to the editing line
- Use value, copy the numerical value of the constant to the editing line
- To clipboard, copy the numerical value of the constant to clipboard

Fields:

X | The x-axis definition, usual just a t |

Y1 | The first curve/column, write a expression with t as independ variable |

Y2 | The second curve/column, write a expression with t as independ variable |

Start | Starting value for t |

End | Final value for t |

Steps | Number of steps between starting and ending value, the X/Y1/Y2 are calculated once for each step |

Log steps | Use logarithmic steps |

Auto scale | Automatic scale the graph to contain the curve |

Use same scale | Y1 and Y2 is displayed with the same scale |

Left/Right | Min/Max X value displayed |

Bottom/Top | Min/Max Y value displayed |

Log x/y scale | Use logarithmic scales |

Draw | Make a curve |

Fill | Make a table |

Right click for more options:

- Curve to clipboard, copy the curve picture to the clipboard for use elsewhere

Right click for more options:

- Table to clipboard, copy the table data to the clipboard for use elsewhere, a TAB delimetered format is used
- Table to clipboard XY, copy the X and Y from the table to the clipboard for use elsewhere, a TAB delimetered format is used
- Table to clipboard Y, copy the Y data from the table to the clipboard for use elsewhere, a TAB delimetered format is used

- Just the number, as in 123
- Binary, as in 1001B or 1001b
- Octal, as in 177O or 177o
- Hex, as in 1f5H or 1f5h or 0X1f5 or 0x1f5 or $1f5, all values must start with a digit in the 0..9 range, ffh is not valid, use 0ffh
- Decimal, as in 12.34. Only . (point) is accepted as decimal point, a , (comma) is used as a parameter delimeter and can not be used as decimal point
- Exponent as in 12.34e3 or 12.34E3 or 12e3 or 12E3 (When E is used without a number after, it is a SI prefix and multiplies with 1E18)
- With appended SI prefix as in 12.34k or 12.34M, accepted prefix are YZEPTGMKkcmuµnpfazy
- With SI prefix as point, as in 12k34 or 12u34, accepted prefix are YZPTGMKkcmuµnpfazy (i.e. E is missing)
- With binary SI prefix, as in 12ki=1024, accepted prefix are YZEPTGMKk

() | Brackets |

* | Multiplication |

/ | Division |

% | Returns the remainder of a division, only supported for integers |

+ | Addition |

- | Subtraction |

BitOr | Bitwise OR function, only supported for integers |

BitAnd | Bitwise AND function, only supported for integers |

BitXOR | Bitwise XOR function, only supported for integers |

= or == | Equal, result is False=0, True=1 |

<> | Not equal, result is False=0, True=1 |

< | Less, result is False=0, True=1 |

<= | Less equal, result is False=0, True=1 |

> | Greater, result is False=0, True=1 |

>= | Greater equal, result is False=0, True=1 |

| or OR | Logical or (0=False, all other values=True), only supported for integers, result is False=0, True=1 |

& or AND | Logical and (0=False, all other values=True), only supported for integers, result is False=0, True=1 |

integer?expression1:expression2 | Returns expression1 if integer is non-zero else result is expression2 |

expression | Any expression can be used as a statement |

variable:=expression | Assignment to a variable is a statement (variables must be created before use) |

var name; | Create a local variable named "name", this variable will not be shown on the "Variables" page and not saved, defining a variable multiple times is valid and will not change the value of the variable |

if (expression) statements else statements endif | A if statement with or without the else part |

Use VarType(Variable) to check the type of a variable.

Integer | Numbers without a decimalpoint i.e. 1 2 3 4 etc. |

Real | Numbers with the posibility for a decimalpoint i.e. 1.7 3.14 etc. (these numbers can also be without digits after the decimal point) |

Complex | Two real numbers, saved as r and i, only some operations are supported on complex numbers |

String | Any sequence of characters, most mathematical operations are not supported on this type |

Array | A list of datatypes, accessed with [index], the first element is always 0 |

Sin/Cos/Tan/ArcSin/ArcCos/ArcTan | Standard trigonometric functions | ||||||||||||||||

todB/todBpwr/fromdB/fromdBpwr | Convert to and from dB | ||||||||||||||||

ArcTan2(y,x) | ArcTan(y/x) angle is in the correct quadrant | ||||||||||||||||

CoTan(x) | Same as 1/tan(x) | ||||||||||||||||

Hypot(x,y) | Same as sqrt(sqr(x)+sqr(y)) | ||||||||||||||||

sinh/cosh/tanh/ArcSinh/ArcCosh/arcTanh | Hyperbolic trigonometric functions | ||||||||||||||||

Ln/Log10/Log2 | Logarithm functions Natural/base 10/base 2 | ||||||||||||||||

LogN(Base,x) | Logarithm with any base | ||||||||||||||||

Power(value,exponent) | Raises value to exponent | ||||||||||||||||

Exp(x)/ALn(x) | Raises e to the power of x | ||||||||||||||||

ALog(x) | Raises 10 to the power of x | ||||||||||||||||

e | Returns e (base of the natural logarithms) | ||||||||||||||||

pi | Returns pi | ||||||||||||||||

sqr(x) | Returns x*x | ||||||||||||||||

sqrt(x) | Returns square root of x | ||||||||||||||||

SolveSqr(x2,x,c) | Solve a quadrantic equation, the result array may contain complex numbers | ||||||||||||||||

SolvePoly(xn,xn-1,....,x,c)/SolvePoly(array) | Solve a n degree polynomial, the result array may contain complex numbers | ||||||||||||||||

EvalPoly(v,xn,xn-1,....,x,c)/EvalPoly(v,array) | Evaluate a polynomial | ||||||||||||||||

InterpolateSpline(x,x1,y1,x2,y2,x3,y3,....)/InterpolateSpline(x,Array) | Interpolate y from x using spline function | ||||||||||||||||

Array(v1,v2,v3,v4) | Create a array, first value is placed at index 0 | ||||||||||||||||

Arrayr(v1,v2,v3,v4) | Create a array, last value is placed at index 0 | ||||||||||||||||

hex/dec/oct/bin | Returns a hex/dec/oct/bin string of the integer part of the value | ||||||||||||||||

cpx(r,i)/complex(r,i) | Create a complex number | ||||||||||||||||

int(x) | Cuts any digits after the point | ||||||||||||||||

frac(x) | Returns only digits after the point | ||||||||||||||||

ComplexAngle(x) | Returns the angle of a complex number | ||||||||||||||||

ComplexVector(x) | Returns the vector length of a complex number | ||||||||||||||||

ComplexR(x) | Returns the real part of a complex number | ||||||||||||||||

ComplexI(x) | Returns the complex part of a complex number | ||||||||||||||||

StdR(x)/StdC(x)/StdL(x) | Round value to standard for specified component | ||||||||||||||||

StdE3(x)/.../StdE192(x) | Round value to specified standard | ||||||||||||||||

FilterLP1(f0,f) | Calculate the attenuation in dB for a first order low pass filter with 3 dB frequence f0 at frequence f | ||||||||||||||||

FilterHP1(f0,f) | Calculate the attenuation in dB for a first order high pass filter with 3 dB frequence f0 at frequence f | ||||||||||||||||

FilterLP1cpx(f0,f) | Calculate the complex factor for a first order low pass filter with 3 dB frequence f0 at frequence f | ||||||||||||||||

FilterHP1cpx(f0,f) | Calculate the complex factor for a first order high pass filter with 3 dB frequence f0 at frequence f | ||||||||||||||||

RIAA(freq) | Convert a frequence to RIAA dB value | ||||||||||||||||

RIAAIEC(freq) | Convert a frequence to RIAA, with IEC modification dB, value | ||||||||||||||||

RIAAcpx(freq) | Calculate the complex factor for a frequence according to the RIAA specification "todB(ComplexVector(RIAAcpx(freq)))" is the same as "RIAA(freq)" | ||||||||||||||||

RIAAIECcpx(freq) | Calculate the complex factor for a frequence according to the RIAA, with IEC modification, specification | ||||||||||||||||

CRC8(poly,initial,string)/CRC16(poly,initial,string)/CRC32(poly,initial,string) | Calculate crc for specified string. Some standard poly's:
*Using 0 as poly will preload this poly and initial value, ie. using crc32(0,0,data) is the same as using crc32($edb88320,$ffffffff,data); I your need code for crc calculations see CRC calculations Remark:All these functions are working with inverted poly's, see CRC and Checksum hints for more explanation
| ||||||||||||||||

CRCPoly(coefficients) | Calculate a poly value from a list of coefficients i.e. CRCPoly(16,15,2,0) gives $a001 as poly value for x^16+x^15+x^2+x^0 | ||||||||||||||||

CRCPolyReverse(ReversePolyValue) | Reverse all bits in poly value. The poly value used here is with lsb coefficient FIRST and msb-1 coefficient last | ||||||||||||||||

BoxSurface(x,y,z) | Calculates the surface area of a box. To estimate the mass of the box use (for a 10*20*30cm box made of 1mm aluminium): BoxSurface(100m,200m,300m)*1m*aluminium_density | ||||||||||||||||

UnitConversion(FromUnit,ToUnit,Value) | Convert a value between any two units. Both full and short unit names can be used. Example: UnitConversion("atm","mmHg",1) | ||||||||||||||||

ToSI(Unit,Value) | Convert a value to corrosponding SI unit | ||||||||||||||||

FromSI(Unit,Value) | Convert a value to from corrosponding SI unit | ||||||||||||||||

- A small version of the calculator: TinyCalc (Draw it outside the MiscEl frame)
- Crc calculations: CRC and checksum
- Crc code: CRC calculations
- Serial/parallel connection of R/L/C: Series/parallel
- Ohms law and impedance of L/C: Ohms law
- dB conversions: dB
- Math on a small MPU: Integer math
- Geometry figures: Geometry