Numipulator® Help
Personal Edition 2.0
topaccolades.com
   
Overall Index Index of numipulation box types

Overview

Welcome to Numipulator, an advanced numerical manipulator and calculator from TopAccolades Ltd. Numipulator enables you to carry out calculations on individual numbers and on lists of numbers, to determine properties of lists of numbers, including statistical functions, and to manipulate lists of numbers. In many ways you should find it easier to use than a calculator or a spreadsheet. Numipulator also lets you generate and format tables, both in text and graphical form.

Numipulator has very flexible input/output formatting, which means that you can, for example, copy a complete spreadsheet worksheet (assuming it comprises only numbers) and paste it into a small input field in Numipulator, ready for manipulation and calculation, e.g. searching for rows matching certain criteria. The output from Numipulator's table formatter may be copied and pasted back into a spreadsheet. Numipulator and a spreadsheet working together are a powerful combination.

Individual calculations and manipulations are specified in numipulation boxes. Each of these has a reference name. A reference name may be an input to any other numipulation box, enabling you to string together many calculations and manipulations in order to achieve your desired output, including any formatting of the output, all in one calculation, by pressing the = button.

Numipulator also has a processing engine, which enables you to perform a sequence of calculations using the numipulation boxes, rather than just one. This feature, together with the following features:

  • special memory numipulation boxes that take an output from one calculation and use it as input in the next cycle;
  • the graphics formatter and its ability to display colours and borders, as well as values, for its cells;
  • the graphics formatter's ability to respond to clicks on its cells as inputs to the calculation;
  • input and output mapping of numbers to text and symbols, meaning that you may have text in your interface, inputs and outputs;
enable you to develop fairly sophisticated business applications, games, puzzles and utilities and save these as apps that run within the Numipulator environment. Each app is a complete Numipulator set-up: a set of definitions or specifications. These Numipulator set-ups, called Numiplets, can be saved, either as simple text files or in local storage, if your browser supports this. With local storage, and a browser that allows actions to be carried out when you exit Numipulator, your current set-up is also saved automatically when you exit Numipulator as the Current Saved Numiplet, ready for automatic reloading when you open it again.

Numipulator provides many built-in Numiplets, some business-related, some demonstrations, and some games or puzzles. We suggest you try these early on to help you to see and understand the power of Numipulator.

Essentially, then, when you define the inputs and selected function/operation of the numipulation boxes, including linking them up, and specifying constraints on the number of repetitions, you are creating a program. Numipulator can therefore be considered as providing a programming environment: one where you don't write programs that tell the computer how to go about executing the program. Such programming is called declarative programming.

Important

You are strongly encouraged to save Numipulator locally, on your local PC or device, as this will give you improved performance and also allow you to use Numipulator when you're offline.

The best way to obtain a local copy is to download it from www.numipulator.com. Alternatively, save it as a simple web page from the open Numipulator page (Numipulator consists of a single HTML file only). For example, with Chrome on a Windows PC, bring up the Save As... box (right mouse click or Ctrl-S), then choose the type as 'Web Page, HTML only(*.htm.*.html)' (not as Web Page, complete or any other option), and save to an appropriate folder. Similarly, on a Mac, save it with format Webpage, HTML Only. When you wish to use Numipulator again, just open the downloaded file in a suitable browser.

Numipulation boxes

The main components of Numipulator are numipulation boxes. These are modelled on the way you probably first learned to carry out addition, subtraction and so on at school. There, you probably laid out a simple calculation something like this:

23
45 +
68

That is, the inputs were placed underneath each other, a line was drawn, and the result was put underneath. The operation to be carried out was also made clear (+, or addition, in this case).

A numipulation box is essentially a computerized version of this. For example, a numipulation box for carrying out simple operations on two numbers, such as addition and subtraction, looks like this:

Number Operation
*a
*b
*A1
  
  i  
      
  X  

The components of this are as follows:

  • At the top is a general description of the type of numipulation box - in this case Number Operation.  
  • The next two lines (in this case) are input fields, with labels.  
  • The next line normally consists of a drop-down list, from which you can select the operation (or function in other cases) to be carried out. The text shown in this may refer to the input labels, as in this case.  This operation field separates the inputs from the result.
  • Below this line is a result or output field, which also has a label (A1 in this example).  This label is the reference name of the numipulation box - a key feature, as discussed later. Note: this field is also referred to as the reference field 
  • On the bottom line, with a yellow background, is a note field, in which you can add some text describing the output (or inputs);
  • Also on the bottom line are two buttons, one green and one red:
    • The green i button may be pressed after a calculation to summarize the inputs, their values and the output value. The information supplied is as given by the Values button, but just for this box. This enables you to see the output value (before any rounding), which is particularly useful for Common Numbers and Lists, where the output value is not shown in the box;
    • The red X button clears the input and output values of the box, and changes the function/operation selection back to its default.

Once the inputs have been entered, and the operation selected, the = button (Calculate) may be pressed; the result is shown in the result field (as shown above).

The great advantage of this layout when compared to a calculator is that once the calculation has been carried out you see, or have access to, not only the result but also the inputs and the operation carried out. You won't feel the need to repeat the calculation just in case you entered the wrong numbers or pressed the wrong operation key. And because the standard layout has five Number Operation numipulation boxes, each, by default, ready for a different operation (+, -, X, / and %), in order to carry out the operations commonly found on a calculator you don't even have to select the operation from a drop-down list - just choose the box already displaying this operation.

This layout also provides considerable advantages when compared to a spreadsheet. Most importantly, you don't have to enter a formula just to multiply two numbers together. In fact, with Numipulator, you don't have to enter formulae at all - just select the operation to be carried out (although you can choose to define your own expressions in Row X). Furthermore, the operation remains visible in the box, whereas on a spreadsheet the formula is not generally displayed - only its resulting value.

There are many types of numipulation box, some simpler, some more complex than the Number Operation box. When the = button is pressed, all the calculations are carried out and the results put into the results fields.

Note: to display Help specific to a particular type of numipulation box, click on the numipulation box heading, or type name, (e.g. the words 'Number Operation') at the top of the numipulation box. This will open up the Help page in the Information Zone and move to the beginning of the relevant section of the page. You can also get relevant Help for other features by clicking on other headings including: 'Constants and Internal Values', 'Repetitions', 'Table Formatter', and 'Graphics Formatter'.

Information Zone

This is an area near the top of the page which is opened when you request further information or output, e.g. Help, Getting Started, Notes, Values and Flow. To close this, just tap on its Close button.

Main Buttons

These buttons are found down the left side of the page. They should remain in this position even when the page is scrolled, so should always be available.

: Make the whole page visible (but not necessarily the Information Zone), and scroll to the top of the page.

Help : Open this Help page in the Information Zone.

IM : Initialize Memories: for every Memory Number or Memory List, replace the text in the mem field with the text in the init field, unless the init field is empty.

Clear : Clear/Reset All (clear all inputs and outputs, and set operation selections and most other settings (inc. rounding and separator) back to their defaults). Note: in case you accidentally press this, all your settings are saved in the Main Output window towards the bottom of Numipulator.

Notes : Show, in the Information Zone, the reference name and accompanying note for any numipulation box that has a note defined.

Values : Show, in the Information Zone, the definitions, values and notes for numipulation boxes and other fields involved in the last calculation, in the order of evaluation.

Flow : Show, in the Information Zone, the relationships between all defined numipulation boxes and other fields, in a top-down fashion.

Save : Save current set-up to local storage, as Current Saved Numiplet, or, if local storage is unavailable, show the current set-up in the Information Zone ready for saving to a text file.

= : Calculate (carry out one set of calculations).

Start : Initialize memories, then start a series of repetitions, as defined by the Repeat until condition.

Go : Start, or continue, a series of repetitions, as defined by the Repeat until condition (with no memory initialization).

Stop : Stop a series of repetitions (Repeat for or Repeat until) at the end of this cycle and display the results so far.

Numbers and lists

The Number Operation numipulation box deals only with numbers. Others deal with numbers and lists of numbers, or just with lists.

Most people are familiar with lists of numbers. After or during shopping, we may want to add up the total of everything we've bought from a number of shops; or, we may want to look through a list of prices and select the most or least expensive or check how many items we bought. Numipulator differs from calculators and spreadsheets in that lists are handled as core object types, which can be manipulated as a whole. Lists, whether as inputs or results in numipulation boxes, are always shown as multiline text areas, in contrast to numbers, which are shown as single-line text fields.

One of the simplest types of numipulation box that handles lists is the List Function to Number box. This takes a list as its input and produces a number as its result.

List Function to Number
*la
*C1
  
  i  
      
  X  

This numipulation box lets you easily find out several simple properties of the list, such as the sum of all its values, the number of items, the minimum, the maximum, or the average. For the more statistically-minded, it also lets you calculate properties such as the median, first quartile, variance or standard deviation.

In many cases, lists are handled item by item. This makes Numipulator very convenient for handling many numbers when you wish to carry out the same operation on each. So, for example, the Items Operation numipulation box carries out the same operation on corresponding items in two lists to give the resulting list, as shown in the first example below. If the second list consists of just one item, it will carry out the same operation using this number on each of the items in the first list, as shown in the second example below.

Items Operation
*[a]'
*[b]"
*V1
  
  i  
      
  X  
Items Operation
*[a]'
*[b]"
*V1
  
  i  
      
  X  

In some cases, a list consists of a set of parameters for an operation. So, for example, the List Generation numipulation box with numbers 1, 3, 8, 11 in the input field and a selected operation of 'Integers p1->p2' generates a list of integers for each pair of numbers, i.e. from 1->3 and 8->11 in the input list, giving a result list 1, 2, 3, 8, 9, 10, 11.

List Generation
*p1,p2...
p1,p2...
...
*G3
  
  i  
      
  X  

Entering numbers and lists

Putting in a number into a number field is straightforward. Just type or paste a single number into the field. This may be an integer (whole number), negative number, a decimal fraction (e.g. 3.25, 4.01 or .2), or an e-notation number (e.g. 2.4e+3, which means 2.4X103 or 2400) . Note: if you use a decimal point, it must have at least one numeral after it; 32. is unacceptable - use 32 or 32.0 instead.

A list is simply a sequence of numbers separated by one or more of the following: space, tab, paragraph (newline or carriage return), comma (,), forward slash (/), semicolon (;) or colon (:). Note: your browser will probably not allow tabs to be entered when typing, but you can paste in lists that use tab-separated items. So, the list of numbers 1, 2, 3 may be entered in a list field as, for example:


This makes Numipulator input straightforward, as the numbers may be copied from many other applications, such as spreadsheets, in their native format and then pasted into the list field. Although the list field is small, you may paste a very large table from a spreadsheet into it; it won't be easy to see, but it will be there. The different types of separator also enable you to format your inputs, if you wish; in the List Generation example above, the two pairs are shown on different lines, while the two members of each pair are separated by a comma and space, so that the pairs of parameters stand out.

Comments

A list, or even a number, field may also include comments. A comment begins with an opening curly bracket, {, and ends with the next closing curly bracket, }. The comment is treated as a separator, but is otherwise ignored.

Tables

Although lists and numbers are the only core object types in Numipulator, some numipulation boxes are designed to perform operations on or transformations of a table. In such cases, the input table is always defined by two inputs: a list and a number (a positive integer).

  • The list (given the identifier la) always represents the values in the cells of the table, laid out along the rows (starting at the top row and always going left-to-right).
  • The number (given the identifier ncols) always represents the number of columns in the table;

So, the input table

1 2 3 4
6 3 2 7
8 9 0 1

would be represented by la=1, 2, 3, 4, 6, 3, 2, 7, 8, 9, 0, 1 and ncols=4

The number of rows in the table is, of course, implied by la and ncols.

Because the only core object types in Numipulator are lists and numbers, a table cannot be the result of a numipulation box. However, the list of cell values can, of course, be given as the result. So, for example, if the above input table had its rows and columns transposed in an operation, giving the table

1 6 8
2 3 9
3 2 0
4 7 1

the result would be given as the list of cell values (starting at the top row and always going left-to-right):

1, 6, 8, 2, 3, 9, 3, 2, 0, 4, 7, 1

Note: Numipulator uses the number of columns as a parameter (rather than number of rows) because tables of data in spreadsheets are generally designed to have a fixed number of columns, but a variable number of rows, so, when handling a table, the number of columns is generally a given. Numipulator bases its handling of a table where la is an empty list accordingly, i.e. treating the input table as still having a given number of columns, but no values in these (i.e. 0 rows). So, if la=L0 (representing an empty list, as discussed later) and ncols=3, the sums of its columns would be 0, 0, 0 (3 columns, each with a sum of 0), while the sums of its rows would be L0 (an empty list, as there are no rows).

Note: Numipulator also provides a single Table Formatter and a Graphics Formatter. These take a list of numbers and format the list as a table (the Table Formatter allows you to specify a certain number of rows or columns, with the numbers laid out either horizontally or vertically). These, however, are not numipulation boxes and their outputs cannot be used as inputs to any numipulation box. They are for displaying results only.

Use of reference names in input fields

You can, of course, just enter numbers or lists of numbers into the input fields and treat Numipulator as a powerful, easy-to-use calculator. But to get the most value from it, you need to make use of reference names. These allow you to specify that the resulting value of one numipulation box should be used as input to another numipulation box. In this way, complex calculations can be carried out with one press of the = (Calculate) button.

The value of a numipulation box during a calculation is defined as:

  • the result of the operation in the box, if there is one (which will be shown in the result or reference field);
  • the value defined by the reference field of the box, i.e. its input, if there is no operation in the box (e.g. Common Number or Memory Number).

As a simple example, if you bought something for 25.30 and sold it for 37.15, and you had to pay 20% tax on the difference, you could calculate the tax due using two Number Operation numipulation boxes, where the difference (A1) is an input to A2, which calculates 20%:

Number Operation
*a
*b
*A1
  
  i  
      
  X  
Number Operation
*a
*b
*A1
  
  i  
      
  X  

The reference name for a numipulation box whose value is a number may, of course, also be used in a list. So, for example, if the set-up included A1 and A2 as above, an input list might be defined as 42.36, A2, 53, where the value of A2, i.e. 2.37, is the second item.

The reference names for lists may also be entered into other fields. There are three cases to consider:

1) Simple reference of one list for another list input.

This specifies that the value, or result, of G3 should be used as the input.

2) Combination of reference names and/or numbers

In these cases - and 1) is just a simple case of this - the items of the lists referred to are inserted as items of the input list. So, if G3 had a value 5, 6, 7, while A2 had a value 49 and G4 had a value 34, 35, 36, then the input list would be 46, 5, 6, 7, 49, 34, 35, 36.

3) A list reference name as input to a number field

The reference name of a numipulation box that has a list value may also be specified as the value of a number input field. In this case, the number taken as the input is the first item on the list. So, if G3 has a value 5, 6, 7, and G4 has a value 34, 35, 36 and you enter G3 and G4 as the inputs of a Number Operation addition, the result would be 39 (i.e. 5 + 34).

This feature makes Numipulator very flexible and has two main uses:

a) You can use numipulation boxes concerned with operations on items of a list to handle single numbers.

Several numipulation boxes are concerned with operations on items of a list. For example, as well as Number Operation numipulation boxes concerned with the addition, subtraction, and so on, of simple numbers, there are also Items Operation boxes dealing with the same operations on corresponding items in a list. A list may, of course, have just one item, so you could put individual numbers into each of the input fields of an Items Operation box and have a result that is also a list with a single number. The ability to use reference names of lists in inputs to number fields means that you can effectively treat Items Operation numipulation boxes as additional Number Operation boxes (and others similarly) if you find the need.

Because of this feature, Numipulator does not include individual number-only versions of some of its more complex numipulation boxes (Measure Conversions or If-Then-Else boxes, for example); the list versions supplied can be freely used to handle single numbers.

b) You can operate on the first item of a list without any intermediate step

If you know that you're interested only in the first item of a list (maybe you've already sorted it in descending order and want to operate only on the largest number), you can specify the list as the input to a number field, without needing explicitly to extract the first number.

Common Numbers and Common Lists

Frequently, you will want to carry out some calculations on the same number or list (which you already know, and don't need to calculate), or you will just want to enter your input data, numbers or lists in some convenient locations. The Common Number and Common List numipulation boxes, found in rows D and E, are available for this purpose. These have input fields only and no separate output/result field. Enter the number or list in the only field of these boxes (apart from Note, of course) and refer to it as input to any other numipulation boxes.

There are also wider Common Number boxes (called Num1 and Num2) and wider Common List boxes (called List1 and List2) near the Table Formatter. These are particularly suitable for entering data where you wish to include comments, or make use of the wider note field. Many of the built-in Numiplets make use of these, as they are close to the Table and Graphics Formattters.

Note: You can also enter reference names in these input fields, but you will not see the resulting value displayed in the box. It will continue to display the reference name(s). Pressing the green 'i' button to the right of the note, will show you the value, if you wish to see it, following a calculation.

So, if you wanted to calculate the difference between the maximum and minimum values of list 3 2 4 6 5 7, enter this in Common List E1. You could then enter E1 as the input of C1 and select Maximum value, and also as the input of C2 and select Minimum value, and enter C1 and C2 as inputs of A1, with the Subtract operation selected. The results would be:

C1=7
C2=2
A1=5

Note: this is by way of example; you could calculate the difference between the maximum and minimum values more easily by entering the list as input to C1 and selecting Range.

Ensuring you enter the correct reference name

The numipulation box you wish to refer to may be some way away from the box in which you're entering its reference name. It is easy to forget the reference name or mistype it. Numipulator provides two facilities to help you:

Transfer of reference name using the asterisk

If you click on the reference name of a numipulation box, i.e. on the bold, white name to the right of the reference field, this reference name is remembered by Numipulator. It is also shown in the Selected Name field, in the middle near the top of the page. At any time after that (until you click on a different reference name), if you click on the asterisk (*) to the left or below an input field (list or number), the reference name will be inserted into the field. The mode of insertion differs for number fields and list fields:

  • for number fields, which can take only one value, the reference name replaces any existing input value;
  • for list fields, which can take any number of values, the reference name is added at the end of any existing values.

Showing notes

It is good practice, when undertaking complex calculations, to enter a note in each numipulation box, to remind yourself of what the value refers to, e.g. Co-ordinates of X; Initial Amount; Interest Rate; or Price List. To help you quickly see which reference name you should be entering, you can press the Notes button on the left; this will display the reference names and accompanying note of each numipulation box with a note in the Information Zone.

Constants and Internal Values

Underneath the main rows of numipulation boxes is a box labelled Constants and Internal Values. This lists the built-in unchangeable values you can use, namely pi, e and L0 (that's L-zero not L-oh). It also contains the name of a list called now that is concerned with the date and time, cycle, which refers to the repetition cycle, and click, which indicates whether a mouse-click has occurred in the Graphics Formatter. These are reference names that can be used like any reference name, i.e. you can enter them in input fields and you can click on the names in the Constants and Internal Values box to put the reference name into memory ready for placing in input fields via the asterisks.

The first two, pi and e, represent the well-known mathematical constants π, approx. 3.142, and e (the base of natural logarithms), approx. 2.718.

The third item, cycle, has the value of the current repetition cycle. If repetitions are carried out (e.g. using the Repeat for or Repeat until features), cycle is set to the number of the cycle: the first cycle is 1, the second is 2, and so on. If a single calculation is carried out (by pressing an = button), this will have the value 1.

The fourth item, click, has only two possible values, 1 or 0. In any calculation cycle, its value is 0 unless a mouse-click has occurred and been acknowledged in the Graphics Formatter just before this cycle, in which case it has the value 1.

The fifth, L0, represents the empty list, i.e. a list with no items (think of it as the list equivalent of the number 0 - a list with zero items). This symbol is also output in a result field if the result is a list with no items. For example, if you use a Find All numipulation box to find all the items in list 10, 20, 30, 40, 50 that are greater than 60, Numipulator will, of course, find no items. Rather than leave the result field blank, the result L0 is output. You can also enter it as an input in list fields (see later for why you might want to do this). If, however, you enter it in a number field, the calculation will result in an error message in the result field, since an empty list has no first item that can be used in the calculation.

The sixth item, now, is a list of numbers associated with the time and date. The values on the list are calculated at the beginning of a calculation cycle (i.e. as soon as an = button has been pressed, or at the beginning of each repetition cycle). The list contains 7 items, all referring to the local date/time determined at this moment (according to the user's computer). The examples below assume the date is April 3, 2025, and the time is 16:25:05 (i.e. 5 seconds after 4:25pm)

Date Format: The date in YYYYMMDD format. Example: 20250403
Year: Example: 2025
Month: Example: 4
Date: 3
Hour: 16
Minute: 25
Second: 5

so the full value of now would be: 20250403, 2025, 4, 3, 16, 25, 5

Remember: This value is evaluated once and once only in each calculation cycle: at the beginning.

Items and cycling

Many numipulation boxes have, as one of their list inputs, a list that is to be treated as a set of individual items. If there is only one of these, the length of the item list determines the length of the resulting list, since the operation is carried out for each item on the list of items in turn, and the individual results determine the output.

The label of such a list is always given in square brackets, e.g. [a] or [b]. The descriptions of the operations that can be selected generally refer to the letter inside the brackets. So, for example, a Count numipulation box has two input lists, la and [b]. A typical operation that can be selected is Items in la < b. Given an input list la = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and a list of items, [b] = 12, 5, 0, the result would be 10, 4, 0 (i.e. 10 items < 12, 4 items < 5 and 0 items < 0).

Several types of numipulation box carry out operations or comparisons on the corresponding items of two or more lists. For example, the Items Operation box takes two lists and carries out simple operations such as addition or subtraction on the corresponding items. So, we saw above that in such a numipulation box, if the first list contains items 2, 4, 6, 8 and the second 3, 4, 5, 6, then selection of the Add operation results in the list 5, 8, 11, 14.

Clearly, for this to work the operation has to have the same number of items to work on. But, in fact, as seen in the second Items Operation example earlier, we can have several items in the first, but only one in the second. This is because Numipulator allows cycling of items, as explained next.

If there is more than one list of items, one of these - and it's always the top one - is treated as the primary item list, and given a single quote after its name to denote this, e.g. [a]'. All others are treated as secondary item lists, and given a double-quote after their names to denote this, e.g. [b]". The primary item list determines the number of operations carried out, since the operation is carried out on each of its items in turn. The secondary items are taken one at a time to be used in these operations; if the end of a secondary item list is reached but there are still items in the primary list to be dealt with, items are selected from the beginning of the secondary list again. That is, the secondary items are cycled to match the primary items.

To demonstrate, suppose the primary list, [a]', has values 2, 4, 6, 8 - that is, 4 items. Let's look at what happens if a secondary item list has 1, 2, 3, 4 or 5 items in it.

  • if [b]" has one item = 10, then it is treated as the list 10, 10, 10, 10
  • if [b]" has two items = 10, 20, then it is treated as the list 10, 20, 10, 20
  • if [b]" has three items = 10, 20, 30, then it is treated as the list 10, 20, 30, 10
  • if [b]" has four items = 10, 20, 30, 40, then it is treated as the list 10, 20, 30, 40
  • if [b]" has five items = 10, 20, 30, 40, 50, then it is treated as the list 10, 20, 30, 40 - i.e. any surplus items are ignored

The common cases, where there is just one item in a secondary item list or the same number as in the primary item list, can be seen to be special cases of this general approach to handling more than one item list.

Parameters and excess parameters

Several numipulation boxes (List Generation, Range Selection, Table Operation and Formula) have a list input where the list is treated as a list of parameters. The label for such a list always begins p1,p2 . The operation selected includes information about the number of parameters expected (e.g. Integers p1->p2 implies 2 parameters; p1 random ints p2->p3 implies 3 parameters).

In all cases, the list may include more than one set of these parameters. So, for example, an input list 2, 5, 8, 12 for Integers p1->p2 would yield a result 2, 3, 4, 5, 8, 9, 10, 11, 12 (i.e. integers 2->5 followed by integers 8->12). If the number of parameters in the input list is not a whole number multiple of the number of parameters expected, any excess ones are ignored. So, for example, if the input list to Integers p1->p2 were 2, 5, 8, 12, 14, the last number 14 would be ignored and the result would be the same as for an input list 2, 5, 8, 12.

Mostly, the sets of parameters are considered as independent, and the result list consists of the results based on the first set of parameters, followed by the results based on the second set of parameters, and so on - as shown for the Integers p1->p2 example above. With Range Selection, however, the sets of parameters are considered all together, and only one set of results is produced. The label of the parameter list denotes this using the character '|' (read it as OR) as a separator between the sets of parameters:

p1, p2 |
p1, p2 | ...

Formatting list results

By default, when list results are displayed, the items on the list are separated by an end-of-line/new paragraph, i.e. each item on a new line. You may choose to change this by clicking on a different radio button under Output Separator for Lists in the Settings box towards the bottom of the Numipulator page. You can choose to have items separated by a comma, a semicolon, a space, a comma+space, a semicolon+space, or a tab. All list result displays will use the selected separator.

Numipulation boxes - layout

Most of the numipulation boxes are laid out as a table. As standard, Numipulator has 5 columns. The following description is essentially for a 5-column layout.

The rows are A, B, C ... Z, while the columns are 1, 2... 5. The reference names of the boxes are derived from their positions in the tables:

A1, A2, A3, A4, A5
B1, B2, B3...........
....
Z1, Z2, Z3, Z4, Z5

Note: There are 24 rows: there are no rows for letters I and R.

The general layout is that the more commonly-used numipulation boxes are towards the top. So, the operations or functions normally found on a simple calculator are in rows A and B, while simple functions of lists, e.g. summing up the items, are found in row C. Memory Number and Memory List, are in rows Y and Z - close to the Repetitions area, as they are generally used with repetitions.

There are also two other numipulation boxes, which are wider than others, just below row Z, on either side of the Constants and Internal Values box. These are a Formula box and an Equation Solver box. The expectation is that these will normally be used for single calculations, hence there is only one of each.

Additional numipulation boxes

At the end of each row of boxes (A-Z) are two buttons: a + and a -. Pressing the + button adds a new box at the end of the row, with an appropriate reference number, e.g. A6. There is no theoretical limit to the number of additional boxes. Pressing the - button removes the end numipulation box, although you may not have less than 5 boxes in each of these rows.

Navigation

Near the top of the Numipulator page, on the right, is a drop-down menu of the sections of the page (except for the Information Zone), including the individual rows of the main table. Selecting one of these hides the sections between the menu area at the top and the selected area, so that the selected area is near the top. You may restore the hidden sections, and move to the top of the page, by pressing the white up-arrow on a black background to the left of the menu, or the white up-arrow at the top of the main buttons on the left.

Numipulation boxes - types and operations

Please note that the following symbols for number comparison are used in some of the descriptions below:
< means less than; <= means less than or equal to; = means equal to; <> means not equal to (less than or greater than); >= means greater than or equal to; > means greater than.

Number Operation - Row A

These take two numbers as inputs and produce a number as a result.

Add: a+b

Simple addition of a and b. Example: a=5, b=2: Result=7

Subtract: a-b

Simple subtraction of b from a. .Example: a=5, b=2: Result=3

Multiply: aXb

Simple multiplication of a and b. Example: a=5, b=2: Result=10

Divide: a/b

Simple division of a by b. Example: a=5, b=2: Result=2.5

%: aXb/100

Result is b% of a. Example: a=150, b=10: Result=15

% add: a+(aXb/100)

Result is a + b% of a. Example: a=150, b=10: Result=165 (150+15)

Note: this is useful for taking a base price (a) and determining price including tax, at rate b%.

Power: a^b

Result is ab. Example: a=2, b=3: Result=8 (i.e. 2X2X2). Example: a=2, b=-3: Result=0.125 (1/(2X2X2).
Example: a=4, b=0.5: Result=2 (square root of 4).
Example: a=-4, b=0.5: Result=NaN (Not a Number, or undefined)

Round a to b dec. pl.

Round a to b decimal places. Example: a=2.3467, b=2: Result=2.35.
Example: a=2.3467, b=1: Result=2.3; Example: a=2.3467, b=2: Result=2.35;
Example: a=2.3467, b=-2: Result=undefined. Example: a=2.3467, b=2.5: Result=undefined.

Div: a DIV b

Integer division (results for non-integer inputs undefined): the number of times a can be divided by b, possibly leaving a remainder.
Example: 7 DIV 4 = 1. Example: 8 DIV 4=2. Example: 9 DIV 4=2.

The above examples deal only with positive integers. But what about negative numbers? There are several ways of handling DIV and MOD (see below) for negative numbers - and they give different results. Numipulator takes the following approach:

a DIV b is a/b rounded down to the nearest integer below (whether a and b are positive or negative).

7 DIV 3 = 2 (2.33 rounded down to 2);
7 DIV -3 = -3 (-2.33 rounded down to -3);
-7 DIV 3 = -3 (-2.33 rounded down to -3);
-7 DIV -3 = 2 (2.33 rounded down to 2).

Mod: a MOD b

Modulo, or integer remainder obtained by subtracting (a DIV b)Xb from a. Results for non-integer inputs are undefined.
Example: 7 MOD 4 = 3. Example: 8 DIV 4=0. Example: 9 DIV 4=1.

a MOD b = a - (a DIV b)Xb in all cases, so

7 MOD 3 = 1 (7-(2X3));
7 MOD -3 = -2 (7-(-3X-3));
-7 MOD 3 = 2 (-7-(-3X3));
-7 MOD -3 = -1 (-7-(2X-3)).

Perm: a!/(a-b)!

Number of permutations of b items from a set of a distinct items (aPb). Results for non-integer inputs and negative numbers are undefined.
Example: 6P2 = 30. This equals 6!/(6-2)! or 6X5

Note: as with factorials generally, these numbers can be very large and may return Infinity or some other error.

Comb: a!/b!(a-b)!

Number of combinations of b items from a set of a distinct items (aCb). Results for non-integer inputs and negative numbers are undefined.
Example: 6C2 = 15. This equals 6!/(2!X(6-2)!) or 6X5/2

Note: as with factorials generally, these numbers can be very large and may return Infinity or some other error.

Check (1/0): a<b

If a<b, the result is 1, otherwise the result is 0.

Other Check (1/0):....operations are similar. If the check is true, the value 1 results; if not, the value 0 results.

Logic (1/0): a AND b

If both a and b are not zero, the result is 1, otherwise the result is 0.

Logic (1/0): a OR b

If either a is not zero, or b is not zero, or both are not zero, the result is 1, otherwise the result is 0.

Logic (1/0): a XOR b

If one of a or b is zero while the other is not zero, the result is 1, otherwise the result is 0.

Logic (1/0): a NAND b

If both a and b are not zero, the result is 0, otherwise the result is 1.

Logic (1/0): a NOR b

If either a is not zero, or b is not zero, or both are not zero, the result is 0, otherwise the result is 1.

Logic (1/0): a XNOR b

If one of a or b is zero while the other is not zero, the result is 0, otherwise the result is 1.

Index: [a,b] 10 cols

For a table with 10 columns, the result is the index or list position of the item at row a column b.
Example: If a=2 and b=3, the result is 13. Example: If a=1 and b=1, the result is 1

This is designed to be useful when using the 10X10 visible area of the Graphics Formatter.

Number Function - Row B

These take one number as an input and produce a number as a result.

Square

The number multiplied by itself, i.e. a2. Example: a=3: Result=9. Example: a=-2: Result=4

Square Root

The (non-negative) square root of the number, i.e. a1/2 or √a.
Example: a=4: Result=2. Example: a=10: Result=3.1623.
Example: a=-4: Result=NaN (Not a Number).

+/-: aX-1

Change sign (multiply by -1). Example: a=-5.6: Result=5.6.  Example: a=5.6: Result=-5.6.

Absolute value

If a>=0, then result=a. If a<0, then result=aX-1.
Example: a=-4: Result=4; Example: a=4: Result=4.

Round to nearest int.

Round to the nearest integer. If the decimal fraction = 0.5, round to next highest integer.
Example: a=3.4: Result=3. Example: a=3.5: Result=4. Example: a=3.6: Result=4.
Example: a=-3.4: Result=-3.  Example: a=-3.5: Result=-3. Example: a=-3.6: Result=-4.

Round to 1 dec. pl.

Round to 1 decimal place. Multiply a by 10, round this to nearest integer, then divide by 10.
Example: a=3.44: Result=3.4. Example: a=3.45: Result=3.5. Example: a=3.46: Result=3.5.
Example: a=-3.45: Result=-3.4.

Round to 2 dec. pl.

Round to 2 decimal places. Multiply a by 100, round this to nearest integer, then divide by 100.
Example: a=3.244: Result=3.24. Example: a=3.245: Result=3.25. Example: a=3.246: Result=3.25.
Example: a=-3.245: Result=-3.24.

Nearest int. <= a

Round to the nearest integer less than or equal to the number. (Sometimes called the floor function).
Example: a=3.1: Result=3. Example: a=3.9: Result=3: Example: a=-3.1: Result=-4.
Example: a=-3.9: Result=-4.

Nearest int. >= a

Round to the nearest integer greater than or equal to the number. (Sometimes called the ceiling function).
Example: a=3.1: Result=4. Example: a=3.9: Result=4: Example: a=-3.1: Result=-3.
Example: a=-3.9: Result=-3.

Reciprocal: 1/a

1 divided by a. Example: a=5: Result=0.2. Example: a=0.2: Result=5.

Increment: a+1

Result=a+1.  Example: a=-3. Result=-2. Example: a=3: Result=4.  Example: a=2.5: Result=3.5.

Decrement: a-1

Result=a-1. Example: a=-3. Result=-4. Example: a=3: Result=2. Example: a=2.5: Result=1.5.

Log base 10

Result=logarithm10(a). The relationship is: a=10Result. Example: a=100: Result=2 (since 102=100).

Log base e

Result=logarithme(a). The relationship is: a=eResult. Example: a=2.718281828459: Result=1 (since e1=2.718281828459).

Antilog base 10

Result=10a.  Example: a=2: Result=100.

Antilog base e

Result=ea.  Example: a=1: Result=2.718281828459.

Factorial: a!

The factorial of a number is defined only for non-negative integers, i.e. for 0, 1, 2, 3, 4, etc. The factorial of a where a >= 1 is aXa-1Xa-2......X1.
For example, the factorial of 4 is 4X3X2X1, which is 24.
The factorial of 0 is defined as 1.

Sine (rads), Cosine (rads) and Tangent (rads)

These trigonometric functions generate the sine, cosine and tangent of angles expressed in radians.
Example: sine(0)=0; sine(pi)=0; cosine(pi)=-1; tangent(pi)=0; tangent(0.785398163397)=1.
Note: the tangent of pi/2 should be infinity, but underlying inaccuracies of defining pi mean that it is given as a large finite number.

Arcsine (rads), Arccosine (rads) and Arctangent (rads)

These trigonometric functions generate an angle, expressed in radians, whose sine, cosine, or tangent, respectively, is the input number. The number of solutions to these is infinite; Numipulator takes the single solutions generated by the underlying Javascript mathematical functions.  Note: the inputs for arcsine or arccosine should lie between -1 and +1; other inputs will yield a result of NaN (Not a Number).
Example: arcsine(0)=0; arcsine(1)=1.570796326795 (pi/2); arccosine(-1)=3.14159265359 (pi); arctangent(0)=0; arctangent(1)=0.785398163397 (pi/4).

Sine (degs), Cosine (degs) and Tangent (degs)

These trigonometric functions generate the sine, cosine and tangent of angles expressed in degrees.
Example: sine(0)=0; sine(180)=0; sine(30)=0.5; cosine(180)=-1; tangent180)=0; tangent(45)=1
Note: the tangent of 90 degrees (pi/2 rads) should be infinity, but underlying inaccuracies of defining pi mean that it is given as a large finite number.

Arcsine (degs), Arccosine (degs) and Arctangent (degs)

Identical to arcsine (rads) etc., but the angle generated is expressed in degrees rather than radians.
Example: arcsine(0)=0; arcsine(1)=90; arccosine(-1)=180; arctangent(0)=0; arctangent(1)=45

Check (1/0): Integer

If a is an integer, the result is 1, otherwise the result is 0.

Other Check (1/0):.... functions are similar. If the check is true, the value 1 results; if not, the value 0 results.

Note: For the checks on Prime, Odd, and Even, a non-integer input value always results in the value 0. For the check on Prime, any value < 2 results in the value 0. The value 0 is classed as an Even number in Numipulator (even though some mathematicians class it as neither odd nor even).

Note: the check for a=0 is equivalent to the logic function NOT. If a=0, the result is 1, while if a=1 or any non-zero value, the result is 0.

Note: the check for a<>0 returns 0 if a=0, and 1 if a is non-zero.

Logic (1/0): NOT a

If a is zero, the result is 1, otherwise the result is 0.

Logic (1/0): a

If a is zero, the result is 0, otherwise the result is 1.

Row: Index a, 10 cols

For a table with 10 columns, the result is the row in which the item at position a in the list of items forming the table occurs.
Example: If a=13, the result is 2. Example: If a=1, the result is 1

This is designed to be useful when using the 10X10 visible area of the Graphics Formatter.

Col: Index a, 10 cols is similar but gives the column in which the item at position a occurs.

List Function to Number - Row C

These take a list as input and produce a number as a result.

Sum of list values

Simple addition of all the numbers in the list. Example: la=2, 4, 6, 8: Result=20.
Example: la=L0: Result=0 (i.e. the sum of an empty list is 0).

Product of list values

The result is obtained by multiplying all the numbers on the list together.
Example: la=2, 4, 6, 8: Result=2X4X6X8=384.

Note: the product of an empty list is defined as 1. So, if la=L0, the result=1.

Average (mean)

The result is the sum of the list values divided by the number of items on the list.
Example: la=2, 4, 6, 8: Result=5. Example: la=L0: Result=NaN (0/0).

Maximum value

The result is the maximum value on the list. Example: la=2, -10, 4, 8, 6: Result=8.
Example: la=L0 (empty list): Result=undefined.

Minimum value

The result is the minimum value on the list. Example: la=2, -10, 4, 8, 6: Result=-10.
Example: la=L0 (empty list): Result=undefined.

Range

The result is the maximum value on the list - the minimum value.
Example: la=2, -10, 4, 8, 6: Result=18. Example: la=L0 (empty list): Result=undefined.

Length of list

The result is the number of items on the list. Example: la=2, -10, 4, 8, 6: Result=5.
Example: la=L0 (empty list): Result=0.

First item

The result is the first item on the list. Example: la=2, -10, 4, 8, 6: Result=2.
Example: la=L0 (empty list): Result=undefined.

Last item

The result is the last item on the list. Example: la=2, -10, 4, 8, 6: Result=6.
Example: la=L0 (empty list): Result=undefined.

First Quartile

This is the 25th percentile of the input list.

For those not used to percentiles, some explanation is required. Even for those familiar with them explanation is due, since percentiles are defined and implemented differently by different systems.

The pth percentile of a set of numbers is a number such that at least p/100% of the numbers in the set are <= this number, and (100-p)/100% of the numbers are greater than or equal to this number. So, the 25th percentile of a set of numbers is one such that at least 25% of them are <= the number, and at least 75% of them are >= the number.  

For example, given 7 numbers 10, 20, 30, 40, 50, 60, 70, the 25th percentile is 20, since 10 and 20 (2/7 of the total (>25%)) are <=20, and 20, 30, 40, 50, 60, 70 (6/7 of the total (>75%)) are >=20. Note: the two subsets have a total of 8 items, since one item, 20, is included in both subsets.  No other number satisfies these conditions.

To determine the pth percentile of a list containing N numbers, the list is firstly sorted into ascending order. Each number then has a rank or position in the sorted list. The rank of the pth percentile is (N+1)Xp/100. So, for 7 numbers, the 25th percentile is (7+1)X25/100=2. So, the 25th percentile is the second item in the sorted list.

In most cases, the rank of the pth percentile will not be an integer. For 5 numbers, for example, the rank of the 25th percentile is (5+1)X25/100=1.5. In theory, any number > 1st number and < 2nd number would satisfy the conditions. Numipulator, like certain well-known statistical applications, interpolates between the two numbers at the ranks on either side of the non-integer rank, i.e. between the 1st and 2nd numbers in this case. So, if the sorted list were 10, 20, 30, 40, 50, then the 25th percentile would be given as half-way between 10 and 20, i.e. 15. If there were six numbers, 5, 10, 14, 25, 27, 30, then the 25th percentile would be at rank (1+6)X25/100=7/4=1.75. Numipulator would give the result as 5+(0.75X(10-5)=8.75.

If the rank of the pth percentile is less than 1 or greater than N, Numipulator gives the result as undefined (some other applications would produce the minimum and maximum values in these extreme cases).

Median

This is the 50th percentile of the input list. See First Quartile for definition of percentile.

Third Quartile

This is the 75th percentile of the input list. See First Quartile for definition of percentile.

Interquartile Range

This is the 75th percentile - 25th percentile. See First Quartile for definition of percentile.

Variance (N)

If the numbers in a list represent some characteristic of a complete population, the variance is Σ((x-mean)2)/N, where x is a value in the list, mean is the average value of the list, and N is the number of items in the list. That is, the variance is the average of the squares of the deviations from the mean. Variance (N) represents this value.

Variance (N-1)

If the numbers in a list represent some characteristic of a sample of a population, the value given by Σ((x-mean)2)/N, i.e. Variance (N) , gives a biased estimate of the variance of the full population. The unbiased estimate is given by dividing by N-1 instead of N. Variance (N-1) represents this value, which is often known as the unbiased variance.

Standard Dev'n (N)

The standard deviation of a complete population is the square root of the variance ( Variance (N) ).

Standard Dev'n (N-1)

The standard deviation of a sample population is the square root of the variance ( Variance (N-1) or unbiased variance). This is often known as the unbiased standard deviation.

Sum of squares

The result is the sum of the squares of all the numbers. Example: la=2, 3, 4: Result=22+32+42=29

Root Mean Square

The result is the square root of the average of the squares of the numbers, i.e. √(sum of squares/N), where N is the number of items.
Example: la=2, 3, 4: Result=√((22+32+42)/3)=√(29/3)=3.109

Sum:X10^n...X10,X1

If the list has n items in it, the result is item1X10n+item2X10n-1+....10Xitemn-1+itemn.
Example: la=2, 3, 4: Result=234

This is intended to generate an integer from a list of its constituent numerals.

Check (1/0): Ascend

If every item on la <= the following item, if any, the result is 1, otherwise the result is 0. An empty list returns 1.

Check (1/0): Descend

If every item on la >= the following item, if any, the result is 1, otherwise the result is 0. An empty list returns 1.

Check (1/0): Unique

If there are no duplicates on la, the result is 1, otherwise the result is 0. An empty list returns 1.

Check (1/0): L0

If la is an empty list (no items) the result is 1, otherwise the result is 0.

Check (1/0): Not L0

If la is an empty list (no items) the result is 0, otherwise the result is 1.

Case: <

The numbers on the list are taken as parameters of a case statement. The list is best considered in groups of 3, as follows:

a b c
d e f
g h i
j

The meaning is:
if a<b then the result is c else
if d<e then the result is f else
if g<h then the result is i else
the result is j (where j is the default value if none of the other checks succeed).

If no default value is given and none of the specified checks succeeds, the result is undefined.

Any surplus number (e.g. if there were a number k above) is ignored.

Example: Suppose la is given as:
D1 3 101
D1 4 102
D1 5 103
104 105
and D1 has the value 4. The result is 103 as the first two checks fail, but the 3rd one succeeds.

If D1 had the value 7, the result would be the default value 104 (the surplus number 105 is ignored). If the numbers 104 and 105 were removed from la, the result would be undefined in this case, as no checks succeed and there is no default value.

Other Case: ... functions (except Comp) operate similarly, but with a different comparison operator.

Case: Comp

The numbers on the list are taken as parameters of a more complex case statement, where the checks in each can be different. The list is best considered in groups of 4, as follows:

a b c d
e f g h
i

The second item in each group of 4 represents a comparison operator. This should be an integer from 1 through to 6:

1 means <
2 means <=
3 means =
4 means <>
5 means >=
6 means >

So, the meaning of:
a 1 c d
e 3 g h
i
is:
if a<c then the result is d else
if e=f then the result is g else
the result is i (where i is the default value if none of the other checks succeed).

Example: Suppose la is given as:
D1 1 4 101
D1 3 4 102
D1 3 5 103
104 105
and D1 has the value 4. The result is 102 as the first check (D1<3) fails, but the second check (D1=4) succeeds.

The treatment of surplus values and no default value is similar to that for the other Case: functions.

Measure Conversion - Row F

The result is list of the selected conversions for each of the numbers on the input list [a]. For example, if the selected conversion is foot->metre and the input list, [a], is 2, 3, 4, then the result is 0.6096, 0.9144, 1.2192. 

Notes: Some conversions for cases where the input or output is not a simple number, e.g. ft and inches to cm or vice versa, can be found in the Formula numipulation box.

Notes on units:

Many of these conversions are between metric/SI units and Imperial (sometimes used in the U.K. and some other countries) or U.S. measures. Sometimes, Imperial and U.S. measures with the same name are different. They are distinguished here by Imp or US. When measuring volumes, the U.S. measures differ according to whether measuring dry materials or wet materials (i.e. liquids). Only U.S. wet measures are given here (and are noted as US wet).

Both the U.S. and Imperial systems employ short tons and long tons. A short ton is 2000lb; a long ton is 2240lb. However, traditional usage is for 'ton' alone to refer to 2000lb in the US, and to 2240lb in countries using Imperial measures. So, ton(US)=2000lb; ton(Imp)=2240lb.  The hundredweight (cwt) is 1/20 of the respective ton. A tonne, also known as a metric ton, equals 1000kg.

The abbreviation ft-pndal means foot-poundal (a poundal is a U.S./Imperial measure of force).

A calorie has several definitions (close but slightly different values). The International Table (IT) value is defined here. The term Calorie (upper-case C) is also widely used, particularly when discussing nutrition and exercise. 1 Calorie = 1000 calories or 1kilocalorie (1kcal).

Like the calorie, the British Thermal Unit (BTU) has several definitions (close but slightly different values). The International Table (IT) value is defined here.

There are seven measures associated with dates and days:

  • Date: This is an 8-digit integer of form YYYYMMDD. For example, 20060405 is used to represent the date 5 April 2006. This format ensures that dates will sort into chronological order.
  • Day Integer: Each date is associated with an integer. Day 0 is 1 January 1970. Day 1 is 2 January 1970. Day -1 is 31 December 1969, and so on.  
  • Year: The full year, e.g. 1973 or 2006.
  • Month: A number, 1-12, where 1=January and 12=December.
  • Day(1-31): Day of month (1-31).
  • Day(1=Sun): Each day of the week is numbered 1 through to 7. In this format, 1=Sunday and 7=Saturday (typical North American style).
  • Day(1=Mon): Each day of the week is numbered 1 through to 7. In this format, 1=Monday and 7=Sunday (typical European style).

There are conversions to allow you to convert from Date to Day Integer, Day Integer to Date, and Date to Year, Month, Day(1-31) and both forms of weekday numbering. So, Date 20060405 converts to Day Integer 13242. Using these conversions, you can easily calculate the length, in days, between two dates.

Note: the Day Integers used in Numipulator, being based around Javascript, may differ from those in other packages.

There are also many conversions that allow you to convert from so many of a given quantity (e.g. Million, Dozen), or from a unit with an SI prefix (e.g. kilo-, milli-) to individual units. So, if [a] had the value 2, 2.5 and the selected conversion were Dozen 12 then the result would be 24, 30. If the selected conversion were kilo- k (10^3) then the result would be 2000, 2500.

Note: With the default rounding of 12 decimal places, conversions from small SI prefixes, such as atto- and femto-, may give the result 0. Ensure you use the Internal rounding when handling very small numbers.

Note: Different countries or traditions use the same term to mean a different number. For example, a billion may mean 109 (a thousand million) or 1012 (a million million). Most English-speaking countries, including U.S.A. and U.K., now take billion to mean 109, whereas most other countries take it to mean 1012. The two sets of meanings are called Short Scale (billion=109) and Long Scale. Both are given here, so be sure to use the correct one.

List Generation - Row G

All the list generation operations let you generate lists of numbers, based on parameters in the input list. Some operations require one parameter, some two or more parameters. In all cases, more than one set of parameters may be entered; the list generated for the second and subsequent sets of parameters is joined to the end of the list for the first set of parameters. 

Note: In all cases, if a certain number of items to be generated must be specified, the number must be an integer. Similarly, if generating integers within some range, the range limits must themselves be integers. If these numbers are not integers, the result is undefined.

p1 items of value p2

Generates p1 occurrences of the number p2.

Example: parameters=4, 3.5: Result=3.5, 3.5, 3.5, 3.5.
Example: parameters=4, 3.5; 3, 9, 2: Result=3.5, 3.5, 3.5, 3.5, 9, 9, 9 (the extra parameter, 2, is ignored).

Integers p1->p2

Generates all integers between integers p1 and p2 (inclusive).

Example: parameters=4, 8: Result=4, 5, 6, 7, 8.
Example: parameters=4, 8;   2, -2: Result=4, 5, 6, 7, 8, 2, 1, 0, -1, -2

Vals p1->p2 inc by p3

Generates a list, starting at p1, in which all subsequent values differ from the previous one by p3. If the next number to be generated is greater than p2 (if p3 is positive) or is less than p2 (if p3 is negative), the number is not included and generation stops. p1 is always included in the list.
Example: parameters=3, 10, 2: Result: 3, 5, 7, 9.
Example: parameters=3, -5, -2: Result: 3, 1, -1, -3, -5. Example: parameters=3, -5, 2: Result=3
Example: parameters=3, 10, 2, 3, -5, -2: Result=3, 5, 7, 9, 3, 1, -1, -3, -5

p1 vals, start p2, inc p3

Generate a list containing p1 items, starting at value p2, where subsequent values differ from the previous one by p3.
Example: parameters=5, 4, 2: Result=4, 6, 8, 10, 12.
Example: parameters=5, 4, -2: Result=4, 2, 0, -2, -4

p1 pairs: p2 & p3

Generate a list containing p1 pairs of the values p2 and p3.
Example: parameters=3, 1, 2: Result=1, 2, 1, 2, 1, 2.

p1 random ints 1->p2

Generates a list with p1 items, each being a pseudo-random number between 1 and p2 (an integer) inclusive.
Example: parameters=5, 6: Result=4, 3, 6, 1, 6.
Example: parameters=5, 6; 3, 12: Result=2, 2, 3, 6, 4, 1, 10, 7
Example: parameters=5, -4: Result=-2, 1, 0, -4, -2. All these examples give illustrative results.

p1 random ints p2->p3

Generates a list with p1 items, each being a pseudo-random number between integers p2 and p3 inclusive.
Example: parameters=5, 6, 9: Result=7, 6, 9, 7, 8.
Example: parameters=5, 6, 9; 3, 12, 9: Result=9, 7, 8, 6, 9, 9, 12, 10
Example: parameters=5, -4, 4: Result=-2, 1, 0, 3, -2. All these examples give illustrative results.

Dates p1->p2

Generates all dates between integers p1 and p2 (inclusive). The two dates, p1 and p2, must be integers representing a Date as follows: an 8-digit integer of form YYYYMMDD. For example, 20060405 is used to represent the date 5 April 2006. The results will also be integers representing dates in this format.

Example: parameters=20050227, 20050302: Result=20050227, 20050228, 20050301, 20050302.
Example: parameters=20050302, 20050227: Result=20050302, 20050301, 20050228, 20050227.

Primes p1->p2

Generates prime numbers between the given non-negative integers (inclusive). A prime number is a positive integer that has exactly two positive integer factors, 1 and itself.

Note: if either p1 or p2 are not positive integers, the result is undefined.
Note: if p1 > p2, the list of prime numbers is given in descending order.
Note: 1 is not considered a prime number, as it does not have two different positive integer factors.

Example: parameters=1, 20: Result=2, 3, 5, 7, 11, 13, 17, 19.
Example: parameters=20, 1: Result=19, 17, 13, 11, 7, 5, 3, 2
Example: parameters=-2, 2: Result=undefined

Prime factors of p1

Generates a list of prime factors for number p1. This list, which is always ordered in ascending order, is a list of prime numbers that, when multiplied together, result in the number p1. Note: this list can contain duplicates of numbers, e.g. the prime factors of 4 are 2, 2.

Prime factors are defined only for positive integers - the result for all other numbers is undefined.

Example: parameters=6: Result=2, 3
Example: parameters=275: Result=5, 5, 11
Example: parameters=3761: Result=3761 (as 3761 is a prime)
Example: parameters=1: Result=L0 (1 is a positive integer that has no prime factors, since 1, its only factor, is not a prime number.)
Example: parameters=275, 6: Result=5, 5, 11, 2, 3 (the lists for each number are joined together)

Numerals of p1

Generates a list of the numerals found in the number p1. Non-numeric characters, such as -, ., E, are ignored.

Example: parameters=64502, 19: Result=6,4,5,0,2,1,9
Example: parameters=0.123: Result=0,1,2,3
Example: parameters=14, -232: Result=1,4,2,3,2

R:Indices p1->p2,p3 col

The parameters p1 and p2 are positive integers representing the start and end indices in a list of numbers. If this list were laid out in a table with p3 columns, then the result is a list of the row numbers in which these items would be found.

Example: parameters=3,7,5: Result=1,1,1,2,2
Explanation: Place the indices 1->n in a table with 5 columns (as p3=5):
1 2 3 4 5
6 7 8 ....
The indices 3->7 are found respectively in rows 1,1,1,2,2

Example: parameters=7,3,5: Result=2,2,1,1,1 - the reverse of the first example

Example: parameters=8,8,5: Result=2 - returns the row number for index 8

Use: to convert a list index into a table row.

C:Indices p1->p2,p3 col

Similar to the previous one, but the column numbers are returned. Using the same first example, the result would be: 3,4,5,1,2

Example: parameters=8,8,5: Result=3 - returns the column number for index 8

I:[p1,p2]->[p3,p4],p5 col

The parameters p1 and p2 are positive integers representing the row and column numbers of some position in a table with p5 columns, while p3 and p4 represent the row and column numbers of some other item. The result is the list indices of all the items from the first to the second item inclusive.

Example: parameters=1,3,2,2,5: Result=3,4,5,6,7
Explanation: Place the indices 1->n in a table with 5 columns:
1 2 3 4 5
6 7 8 ....
The item at row 1 column 3 has the index 3 while that at row 2 column 2 has the index 7

Example: parameters=2,2,2,2,5: Result=7 - just a single index returned as the start and end items are the same.

p1 (p2<p3:p4 else p5)

The result is p1 occurrences of the result of the if-then-else statement: if p2<p3 then the result is p4, else the result is p5.

Example: parameters=2,D1,4,101,102 and D1=3: Result=101,101
Explanation: As D1<4 the result is 101, and there are two occurrences of this.

p1 (p2<=p3:p4 else p5) and the others with different comparison operators function similarly.

p1 Func p2(p3)

The result is p1 occurrences of the result of the number function with code p2 operating on the number p3.

Number functions have a unique code, which can be seen by pressing the Codes Display link near the top of the main Numipulator page. The beginning of this list is
1 Square
2 Square Root
3 +/-: aX-1
4 Absolute value

Example: parameters=3,1,6: Result=36,36,36
Explanation: p2=1, the code for Square. So, the result is 3 occurrences of the square of 6.

Use: This meta-level operation allows you to select the function to be applied - particularly useful if developing your own Numiplets. For example, you might allow input of an angle either in radians or in degrees; code p2 could be set as 18 or 21 to return the sine of the angle - no need to use two numipulation boxes to produce both results.

p1 Op p2(p3, p4)

The result is p1 occurrences of the result of the number operation with code p2 operating on the numbers p3 and p4.

Number operations have a unique code, which can be seen by pressing the Codes Display link near the top of the main Numipulator page. The beginning of this list is
1 Add: a+b
2 Subtract: a-b
3 Multiply: aXb
4 Divide: a/b
5 %: aXb/100
6 % add: a+(aXb/100)

Example: parameters=1,3,6,4: Result=24
Explanation: p2=3, the code for Multiply... So, the result is a single occurrence of the result of 6X4.

p1 If p2(p3,p4,p5,p6)

The result is p1 occurrences of the result of the if-then-else statement: if the comparison (p2) between p3 and p4 is true then the result is p5, else the result is p6, where the comparison to be carried out is defined by the parameter p2, which should specify a comparison code, 1 to 6. The comparison codes can be seen by pressing the Codes Display link near the top of the main Numipulator page.

Example: parameters=2,1,D1,4,101,102 and D1=3: Result=101,101
Explanation: The comparison code (p2) is 1, which signifies the < comparison. As D1<4 the result is 101, and there are two occurrences of this.

Series:p1 Op p2(p3, p4)

The result is a list of p1 items, where the first is the result of the number operation with code p2 operating on the numbers p3 and p4, as given above for p1 Op p2(p3, p4) .

The second item in the results list is the result of the number operation with code p2 operating on the first item in the results list and p4.

More generally, for any value of n > 1, the nth item in the results list is the result of the number operation with code p2 operating on the n-1th item in the results list and p4. This allows the generation of a series of related items.

Example: parameters=3,4,1,2: Result=0.5,0.25,0.125
Explanation: p2=4, the code for Divide... So, the first item in the results list is 1/2 or 0.5. The second is 0.5/2 or 0.25, and so on.

Example: parameters=4,3,1,2: Result=2,4,8,16
Explanation: p2=3, the code for Multiply... So, the first item in the results list is 1X2. The second is 2X2 or 4, and so on. The nth item in the results list in this example is 2n

Example: parameters=3,6,10000,5: Result=10500,11025,11576.25
As p2=6, the code for % add: a+(aXb/100) , the results are the values at the end of years 1, 2 and 3 of an investment of 1000 with 5% compound interest.

List Function to List - Row H

Sort (ascending)

Sort the list into ascending numerical order. Example: la=3, 2, 4, 5, 1, 3: Result=1, 2, 3, 3, 4, 5

Sort (descending)

Sort the list into descending numerical order. Example: la=3, 2, 4, 5, 1, 3: Result=5, 4, 3, 3, 2, 1

Reverse

Example: la=3, 2, 4, 5, 1, 3: Result=3, 1, 5, 4, 2, 3

Remove duplicates

If a number occurs more than once on the list, the 2nd and subsequent occurrences of the number are removed from the list.
Example: la=3, 2, 4, 5, 1, 3, 2, 6, 0, 6: Result=3, 2, 4, 5, 1, 6, 0

Cumulative sum

This generates a list with the same length as the input list. The value of the number at position n on the result list is the sum of all the numbers on the input list from positions 1 through to n inclusive.
Example: la=3, 2, 4, 5, 1: Result=3, 5, 9, 14, 15.

Cumulative product

This generates a list with the same length as the input list. The value of the number at position n on the result list is the product of all the numbers on the input list from positions 1 through to n inclusive.
Example: la=3, 2, 4, 5, 1: Result=3, 6, 24, 120, 120.

Diffs: item-next

This generates a list whose length is the same as the input list.

The value at position n in the result list is the value at position n on the input list minus the value at position n+1. The last value on the input (which has no item after it) is returned as the last item on the result list.
Example: la=3, 2, 4, 5, 1: Result=1, -2, -1, 4, 1.
Example: la=3: Result=3.

Note: If the Cumulative sum is found for list L, and this result is then reversed and used as the input to Diffs: item-next, the result is the reverse of list L.

Divisions: item/next

This generates a list whose length is the same as the input list.

The value at position n in the result list is the value at position n on the input list divided by the value at position n+1. The last value on the input (which has no item after it) is returned as the last item on the result list.
Example: la=12, 4, 2: Result=3, 2, 2.
Example: la=3: Result=3.

Note: If the Cumulative product is found for list L, and this result is then reversed and used as the input to Divisions: item/next, the result is the reverse of list L.

All but first

The result is the input list but with the first item removed. The result is undefined if the input list is empty.
Example: la=3, 2, 4, 5, 1: Result=2, 4, 5, 1.

All but last

The result is the input list but with the last item removed. The result is undefined if the input list is empty.
Example: la=3, 2, 4, 5, 1: Result=3, 2, 4, 5.

Permutation

The result is a permutation of the input list. Note: although under List Function to List, this is strictly not a function as the input does not uniquely determine the output.
Example: la=1, 2, 2, 3, 4, 5: Result=2, 1, 5, 4, 2, 3 or 5, 2, 3, 4, 1, 2 or any other permutation of the input items.

Ranks (ascending)

Produces the ranks associated with each item on the list when the list has been sorted into ascending numerical order. If several items are the same, then the ranks associated with these items will also be the same.

Example: la=30, 20, 40, 50, 10, 30: Result=3, 2, 5, 6, 1, 3 (Note: as there are two identical items (30) ranked 3rd lowest, there is no item ranked 4; the next highest item (40) is ranked 5.

Ranks (descending)

Produces the ranks associated with each item on the list when the list has been sorted into descending numerical order. If several items are the same, then the ranks associated with these items will also be the same.

Example: la=30, 20, 40, 50, 10, 30: Result=3, 5, 2, 1, 6, 3 (Note: as there are two identical items (30) ranked 3rd highest, there is no item ranked 4; the next lowest item (20) is ranked 5.

Frequency table

Produces a list consisting of each value that occurs on la followed by the number of occurrences (frequency) of this value on la. The values are in ascending order. The result is best considered as a table with two columns.

Example: la=30, 20, 40, 20, 10, 20, 30: Result= 10, 1, 20, 3, 30, 2, 10, 1. Considered as a table with two columns this is:
10 1
20 3
30 2
40 1

List Operation - Row J

A List Operation has two inputs: an input list, la, and a set of parameters, p1,p2... p1,p2... ... .

Some of the operations require one parameter (p1), some two (p1 and p2); this will be clear from the operation names, which always refer to the parameters.

In all cases, more than one set of parameters may be entered; the final result list consists of the results for the first set of parameters, followed by those for the second set, and so on.

Item p1

Result is the number found at the p1th position in la.
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9; parameters (p1)=4; Result=6 (the 4th item on the list).
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9; parameters (p1)=4, 5, 6, 4; Result=6, 9, 11, 6.

First position of p1

Finds the first position in which the number p1 is found in la. Returns 0 if it is not found.
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9.
If parameters (p1)=4, Result=1.
If parameters (p1)=11, Result=6.
If parameters (p1)=8, Result=0.
If parameters (p1)=4, 11, 8: Result=1, 6, 0

p1th Percentile

Returns the p1th percentile of list la (see First Quartile for definition of percentile)
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1)=25, 50, 75: Result=4, 9, 12

Item at rank p1 (asc)

The input list is sorted into ascending order; the result is the p1th item on the sorted list.
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1)=2: Result=3 (i.e. the second lowest number)

Item at rank p1 (desc)

The input list is sorted into descending order; the result is the p1th item on the sorted list.
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1)=2: Result=13 (i.e. the second highest number)

Count items = p1

Returns a count of the number of occurrences of p1 in la
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1)=2, 9, 11, 14, 2: Result=1, 2, 2, 0, 1

Ratio: la length/p1

Returns the length of (number of items in) la divided by p1
Example: la=11, 12, 13, 14, 15, 16;
If parameters (p1)=2: Result=3

Note: if la represents the values in a table, then if p1 is the number of columns in the table, then the result is the number of rows, and vice versa.

Check (1/0): p1 in la

If p1 occurs in list, the result is 1, otherwise the result is 0.

Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1)=2, 9, 11, 14, 2: Result=1, 1, 1, 0, 1

Sum: items p1->p2

The result is the sum of the list of items found at positions p1 through to p2 in la.
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1, p2)=4, 7; Result=37 (=6+9+11+11).
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1, p2)=7, 4; Result=37.
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1, p2)=4, 7, 9, 10; Result=37, 25.
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1, p2)=4, 13; Result=undefined (as there is no position 13).

Product: items p1->p2

The result is the product of the list of items found at positions p1 through to p2 in la. The behaviour is similar to that for Sum:... above

Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1, p2)=4, 7; Result=6534 (=6X9X11X11).

List: initial p1 items

The result is the list of the first p1 items found in la.

Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1)=4; Result=4, 2, 3, 6.

Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1)=0; Result=L0.

Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1)=13; Result=undefined.

List: final p1 items

The result is the list of the last p1 items found in la.

Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1)=4; Result=16, 12, 13, 9.

Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1)=0; Result=L0.

Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1)=13; Result=undefined.

List: items p1->p2

The result is the list of items found at positions p1 through to p2 in la.

If p1 is greater than p2 then the items are also returned in reverse order.

Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1, p2)=4, 7; Result=6, 9, 11, 11.
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1, p2)=7, 4; Result=11, 11, 9, 6.
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1, p2)=4, 7, 9, 10; Result=6, 9, 11, 11, 12, 13.
Example: la=4, 2, 3, 6, 9, 11, 11, 16, 12, 13, 9;
If parameters (p1, p2)=4, 13; Result=undefined (as there is no position 13).

List: insert item p1 @p2

The result is the list la with an additional item, value p1, inserted at position p2. p2 may be any position of la or one more than the length of la (in which case the p1 is inserted at the end of the list). The length of the resulting list is one more than that of la.

Example: la=11, 12, 13, 14; parameters (p1, p2)=7.9, 3; Result=11, 12, 7.9, 13, 14.
Example: la=11, 12, 13, 14; parameters (p1, p2)=7.9, 5; Result=11, 12, 13, 14, 7.9.
Example: la=L0; parameters (p1, p2)=7.9, 1; Result=7.9.
Example: la=11, 12, 13, 14; parameters (p1, p2)=7.9, 6; Result=undefined.

List: subst. item p1 @p2

The result is the list la with the item at position p2 replaced by the value p1. The length of the resulting list is the same as that of la.

Example: la=11, 12, 13, 14; parameters (p1, p2)=7.9, 3; Result=11, 12, 7.9, 14.
Example: la=11, 12, 13, 14; parameters (p1, p2)=7.9, 5; Result=undefined.

List: del. item @p1

The result is the list la with the item at position p1 removed. The length of the resulting list is one less than that of la.

Example: la=11, 12, 13, 14; parameters (p1)=3; Result=11, 12, 14.
Example: la=11; parameters (p1)=1; Result=L0.
Example: la=11, 12, 13, 14; parameters (p1)=5; Result=undefined.

Example: la=11, 12, 13, 14; parameters (p1)=1, 2, 3; Result=12, 13, 14, 11, 13, 14, 11, 12, 14.
The last example is a reminder that all these functions may take more than one set of parameters, with the results all joined together, even though you may not find a use for more than one set of parameters.

List: del. p1 items @p2

The result is the list la with p1 items, starting at position p2, removed. The length of the resulting list is p1 less than that of la.

Example: la=11, 12, 13, 14; parameters (p1, p2)=2, 2; Result=11, 14.
Example: la=11, 12, 13, 14; parameters (p1, p2)=1, 3; Result=11, 12, 14.
Example: la=11, 12, 13, 14; parameters (p1, p2)=4, 1; Result=L0.
Example: la=11, 12, 13, 14; parameters (p1, p2)=4, 2; Result=undefined.

List: shift by p1

The result contains the same items as la, but the positions of the items are shifted by p1 towards the front of the list, with items dropping off the beginning of the list being moved to the end of the list. The value of p1 must be an integer, but may be positive or negative.

Example: la=10,20,30,40,50; parameters (p1, p2)=1; Result=20,30,40,50,10.
Example: la=10,20,30,40,50; parameters (p1, p2)=2; Result=30,40,50,10,20.
Example: la=10,20,30,40,50; parameters (p1, p2)=-1; Result=50,10,20,30,40.

List: map to p1 blocks

The result for a given value of p1 is a list the same length as la, where each item on la is mapped to an integer (1 -> p1) based on its value. These integers represent value ranges (or blocks): p1 equal-sized ranges from the minimum value in la to the maximum value. This is useful when you wish to plot a list of numbers on a graph.

To explain further, if Min is the minimum value in la, and Max the maximum value, p1 block beginnings are defined, spaced out at increments of (Max-Min)/p1, starting at Min. So, if Min is 10, Max is 50, and p1 is 10, there will be 10 block beginnings: 10, 14, 18, 22, 26, 30, 34, 38, 42, 46. Any number on la >=10 (and < 14) will be mapped to 1; any number on la >=14 (and < 18) will be mapped to 2, and so on. Note: any number on la >= 46 and <=50 (rather than < 50) will be mapped to 10.

Example: la=4, 2, 3, 6, 18, 24, 9, 11, 11, 16, 12, 13, 9, 18, 22; parameters (p1, p2)=10;
Result= 1, 1, 1, 2, 8, 10, 4, 5, 5, 7, 5, 6, 4, 8, 10
Example: la=4, 2, 3, 6, 18, 24, 9, 11, 11, 16, 12, 13, 9, 18, 22; parameters (p1, p2)=5;
Result= 1, 1, 1, 1, 4, 5, 2, 3, 3, 4, 3, 3, 2, 4, 5

Note: if la is empty an error message results. If each item on la has the same value, so that blocks cannot be determined, all items are mapped to 1. If p1 is not a positive integer, the result is undefined.

List & List Operation - Row K

These operations take two lists as inputs, and produce a list as a result.

Positions: of lb in la

This returns a list containing, for each element of lb, the position at which this value is found in la. At first sight this looks the same as the First position of p1 operation from the List Operation numipulation box. However, it differs from this in one important aspect: once a particular position has been identified, it is no longer available for further selection. This means that if there are duplicates in la and the same duplicates in lb, both positions will be returned - in contrast to the First position of p1 operation, which always returns the first position of any number, since the operations on the items in the parameter list are independent of each other. If the number being considered in lb does not exist in la, or the positions at which it occurs have already been returned, the position is given as zero.

Example: la=2, 1, 3, 4, 3, 5; lb=3, 2, 7, 3, 3, 4: Result=3, 1, 0, 5, 0, 4 (the 3 and 5 correspond to the two positions of 3 in la. The two zeros are returned because 7 does not exist in la and a third 3 is not available.

This operation allows you to put an unsorted list in la, put a sorted version in lb, and generate the positions at which the items in lb occurred at in the unsorted list.

Example: la=10, -10, 30, 40, 30, 50; lb=-10, 10, 30, 30, 40, 50: Result=2, 1, 3, 5, 4, 6.

Common: In la and lb

Returns a list of all those items that exist in both la and lb. Each value occurs only once in the result. The order is based on the first occurrence of the number in la.
Example: la=1, 2, 3, 4, 5, 3; lb=3, 2, 7, 8, 3, 6, 9: Result=2, 3

Union: In la or lb

Returns a list of all those items that exist in either la or lb. Each value occurs only once in the result. Essentially, the two lists are joined together (la followed by lb) and duplicates are removed.
Example: la=1, 2, 3, 4, 5, 3; lb=3, 2, 7, 8, 3, 6, 9: Result=1, 2, 3, 4, 5, 7, 8, 6, 9

Diff: In la but not lb

Returns a list of all those items that exist in la but not in lb. Each value occurs only once in the result. The order is based on the first occurrence of the number in la.
Example: la=1, 2, 3, 4, 5, 3; lb=3, 2, 7, 8, 3, 6, 9: Result=1, 4, 5

SDiff: In one not both

Symmetrical Diff: returns a list of all those items that exist in la but not lb, followed by those that exist in lb but not la. Each value occurs only once in the result.
Example: la=1, 2, 3, 4, 5, 3; lb=3, 2, 7, 8, 3, 6, 9: Result=1, 4, 5, 7, 8, 6, 9

Remove 1 lb from la

For each item in lb, remove one occurrence of it from la and return the resulting list. Duplicates will be removed from la only if there are corresponding duplicates in lb.
Example: la=1, 6, 2, 3, 4, 5, 3, 6; lb=6, 1, 3, 4, 3: Result=2, 5, 6 (Note: both 3s removed, but only one 6)

Remove all lb from la

For each item in lb, remove all occurrences of it from la and return the resulting list.
Example: la=1, 6, 2, 3, 4, 5, 3, 6; lb=6, 1, 3, 4, 3: Result=2, 5 (Note: both 3s and both 6s removed)

Join la and lb

Simple joining together of la followed by lb.
Example: la=1, 6, 2, 3, 4, 5, 3, 6; lb=6, 1, 3, 4, 3:
Result=1, 6, 2, 3, 4, 5, 3, 6, 6, 1, 3, 4, 3

Sort la by lb (asc)

Takes two lists of equal length as inputs. Returns the items of la re-ordered in such a way as to match the order of corresponding items in lb if this were sorted in ascending numerical order.
Example: la=70, 50, 30, 20, 40, 10; lb=6, 4, 2, 6, 10, 8:
Result=30, 50, 70, 20, 10, 40 (the smallest number of lb is 2, which is in position 3, and 30 is the 3rd item in la; and so on.)

Sort la by lb (desc)

As above, but as if lb were sorted in descending numerical order.
Example: la=70, 50, 30, 20, 40, 10; lb=6, 4, 2, 6, 10, 8:
Result=40, 10, 20, 70, 50, 30

Cross Add: la+lb

To understand this operation, consider la to be the row labels of a table, and lb to be the column labels. The value of a cell at a particular row and column in the table is the row label + column label.

So, if la=10, 20, 30 and lb=1, 2, 3, 4, then the resulting table would look as follows:

      1   2   3 &;nbsp; 4
10 11 12 13 14
20 21 22 23 24
30 31 32 33 34

The list resulting from this operation is the values in the cell tables (extracted row by row, starting at the top), namely: 11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34.

Cross Subtract: la-lb

This is similar to Cross Add, but in this case the resulting cell values are the row label - column label. So, given the same example as for Cross Add, the resulting table is:

      1   2   3   4
10   9  8   7   6
20 19 18 17 16
30 29 28 27 26

so the resulting list is: 9, 8, 7, 6, 19, 18, 17, 16, 29, 28, 27, 26

Cross Multiply: laXlb

This is similar to Cross Add, but in this case the resulting cell values are the row label X column label. So, given the same example as for Cross Add, the resulting table is:

      1   2   3   4
10 10 20 30 40
20 20 40 60 80
30 30 60 90 120

so the resulting list is: 10, 20, 30, 40, 20, 40, 60, 80, 30, 60 90, 120

Cross Divide: la/lb

This is similar to Cross Add, but in this case the resulting cell values are the row label/column label.

XP1:len(lb) of la items and XP2:len(la) of lb

The above Cross... operations allow you directly to undertake some of the basic arithmetic operations on the row labels and column labels of a table. Sometimes, you may wish to carry out more complex operations.  The two XP... operations (standing for Cross-pairs), which should be considered together, each generate a list, and these two lists can then be used as inputs to an Items Operation numipulation box, where you can apply any operation.

Given the same example as for the Cross Add operation, i.e. la=10, 20, 30 and lb=1, 2, 3, 4, then XP1... is the list derived from the table where the row labels are placed in every cell of the row:

      1   2   3   4
10 10 10 10 10
20 20 20 20 20
30 30 30 30 30

so that the result, as a list, is 10, 10, 10, 10, 20, 20, 20, 20, 30, 30, 30, 30.

XP2... is the list derived from the table where the column labels are placed in every cell of the column:

      1   2   3   4
10  1   2   3   4
20  1   2   3   4
30  1   2   3   4

so that the result, as a list, is 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4.

These two lists could now be taken as input an Items Operations numipulation box with any operation selected. For example, selecting the Power operation would yield the list:
10, 100, 1000, 10000, 20, 400, 8000, 160000, 30, 900, 27000, 810000.

Merge: (various types)

To understand merging, you must take the list lb to be the values of a single new column to be added to a table formed by the values of la. Clearly, this table must have the same number of rows as there are values in lb.

So, if la=1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 and lb=30, 40, 50, then imagine la laid out in 3 rows (row-by-row, left-to-right and top-to-bottom:

1 2   3   4
5 6   7   8
9 10 11 12

Merging involves inserting the values of lb to become a new column in the table, either at the start or at the end. The result is the elements of the new table extracted row-by-row (top-to-bottom, left-to-right).

Special cases: if la is an empty list, then the result is lb, while if lb is an empty list, then the result is la.

Merge at start means insert the items of lb to be the first column in the new table. So, given the above example, the new table is:

30 1 2   3   4
40 5 6   7   8
50 9 10 11 12

so the result is

30, 1, 2, 3, 4, 40, 5, 6, 7, 8, 50, 9, 10, 11, 12

Merge at end means insert the items of lb to be the last column in the new table. So, given the above example, the new table is:

1 2   3   4  30
5 6   7   8  40
9 10 11 12 50

so the result is

1, 2, 3, 4, 30, 5, 6, 7, 8, 40, 9, 10, 11, 12, 50

Note: More general merging can be undertaken using the Insert lc @ col d or Merge table lc @ col d operations of Table Construction numipulation boxes.

Case (Map Values)

This treats the elements of the first list (la) separately, and maps each of them to another (or the same) number. The resulting list should have the same number of items as la. The mapping is defined by the values of the second list (lb). The values of lb should be considered as a case statement: a series of groups of 3 numbers, each of which is:
Op Number1 Number2
where Op is a number that specifies a comparison operator (1 means <, 2 means <=, 3 means =, 4 means <> (not equal to), 5 means >=, 6 means >.

The overall meaning of each group of three is: If Item Op Number1 then the result is Number 2, where Item is the Item of list la being considered. So, if the first group of three were 1 0 14, the overall meaning of the group is: If Item < 0 then the result is 14.

If the first group of three fails to deliver a result, the second group is tried, and so on until all groups of three have been tried. If this still has not produced a result, if there are any surplus numbers in lb that could not form a group of three, the first of these is used as the result. If there are no surplus numbers, then the result is the Item itself.

So, if lb were 1 0 8 6 0 4 11, the complete meaning is:
If Item < 0 then the result is 8, else if Item >0 then the result is 4, else the result is 11.

If lb were 1 0 -1, which has no surplus numbers, the complete meaning is:
If Item < 0 then the result is -1, else the result is Item, i.e. all negative numbers are mapped to -1.

Example: la=5, -6, 3, 0, 4, -8 and lb=1, 0, 8, 6, 0, 4, 11, the result is:
4, 8, 4, 11, 4, 8
Example: la=5, -6, 3, 0, 4, -8 and lb=1, 0, -1, the result is:
5, -1, 3, 0, 4, -1

This operation can be used instead of a set of linked If-Then-Else (Items) numipulation boxes: it's less easy to understand at a glance, but does the job.

Find All - Row L

Find All operations are concerned with identifying which items on input list [a] satisfy some relationship with the corresponding items on the second list, [b], and creating a list either of the items that satisfy this relationship or of the positions of those items in [a].

Val of a: a < b

This generates a list of all the items on [a] that are less than the corresponding item on [b].
Example: [a]=4, 3, 5, 4, 6, 7; [b]=5, 1, 5, 8, 10: Result=4, 6, 7
Example: [a]=4, 3, 5, 4, 6, 7; [b]=5: Result=4, 3, 4 (with the usual item cycling, so that [b] is treated as = 5, 5, 5, 5, 5, 5)

Pos of a: a < b

This generates a list of all the positions on [a] whose items are less than the corresponding item on [b].
Example: [a]=4, 3, 5, 4, 6, 7;  [b]=5, 1, 5, 8, 10: Result=1, 5, 6
Example: [a]=4, 3, 5, 4, 6, 7;  [b]=5: Result=1, 2, 4   (with the usual item cycling, so that [b] is treated as = 5, 5, 5, 5, 5, 5)

The other comparison relationships work in the same way.

Count - Row M

For each item, b, on the second input list, [b], count the number of occurrences of items in the first input list, la, that satisfy a given relationship with b. Return a list with these counts as the items.

Items in la < b

p> Example: la=4, 3, 5, 4, 6, 7, 3, 3 ; [b]=3, 4, 5, 9: Result=0, 3, 5, 8 (there are 0 items < 3; 3 items < 4; 5 items < 5; 8 items < 9)

The other comparison relationships work in the same way.

Range Selection - Row N

Range selection is concerned with finding items on the first input list, la, whose values or positions are in one or more ranges (as defined by pairs of parameters, p1 and p2, on the second input list), and returning either the values or positions that are inside one or more of the ranges, or the ones that lie outside all of the ranges.

Important: Unlike other functions with a number of sets of parameters, these parameters are treated as a whole. The | shown on the label should be read as OR. The order of the items in the result is strictly dependent on the order in the input list, la, not on the order of the pairs of parameters.

p1>=Pos<=p2: Val in

This says: find all the positions that lie in the ranges defined by pairs of parameters p1 and p2, and return the values of the items at these positions.
Example: la=10, 20, 30, 40, 50, 60, 70, 80, 90; p1,p2 | p1,p2 | ...=2, 4, 6, 8: Result: 20, 30, 40, 60, 70, 80
That is, all the values found either in positions 2->4 inclusive OR in 6->8 inclusive.
Example: la=10, 20, 30, 40, 50, 60, 70, 80, 90; p1,p2 | p1,p2 | ...=6, 8, 2, 4: Result: 20, 30, 40, 60, 70, 80
That is, all the values found either in positions 6->8 inclusive OR in 2->4 inclusive.  Note: the result is independent of the order of the sets of parameters, being the same as for parameters 2, 4, 6, 8 above.
Example: la=10, 20, 30, 40, 50, 60, 70, 80, 90; p1,p2 | p1,p2 | ...=5, 8, 2, 7: Result: 20, 30, 40, 50, 60, 70, 80 (Note: the ranges overlap, so effectively these sets of parameters (5->8 and 2->7) define the positions 2->8 inclusive.

p1>=Pos<=p2: Val out

This says: find all the positions that lie in the ranges defined by pairs of parameters p1 and p2, and return the values of the items at all positions except those that lie within these ranges.
Example: la=10, 20, 30, 40, 50, 60, 70, 80, 90; p1,p2 | p1,p2 | ...=2, 4, 6, 8: Result: 10, 50, 90
That is, all the values except those found at positions 2->4 inclusive OR 6->8 inclusive.

p1>=Val<=p2: Val in

This says: find all the items whose values lie in the ranges defined by pairs of parameters p1 and p2, and return these values.
Example: la=10, 20, 30, 40, 50, 60, 70, 80, 90; p1,p2 | p1,p2 | ...=15, 35, 50, 70: Result: 20, 30, 50, 60, 70
That is, all the values that are in the ranges 15->35 OR the range 50->70, inclusive.

p1>=Val<=p2: Val out

This says: find all the items whose values lie in the ranges defined by pairs of parameters p1 and p2, and return all items on la except these.
Example: la=10, 20, 30, 40, 50, 60, 70, 80, 90; p1,p2 | p1,p2 | ...=15, 35, 50, 70: Result: 10, 40, 80, 90
That is, all the values that are not in one of the ranges 15->35 OR 50->70, inclusive.

p1>=Val<=p2: Pos in

This says: find all the items whose values lie in the ranges defined by pairs of parameters p1 and p2, and return the positions of these items.
Example: la=10, 20, 30, 40, 50, 60, 70, 80, 90; p1,p2 | p1,p2 | ...=15, 35, 50, 70: Result: 2, 3, 5, 6, 7
That is, the positions of all the values that are in the range 15->35 OR 50->70, inclusive.

p1>=Val<=p2: Pos out

This says: find all the items whose values lie in the ranges defined by pairs of parameters p1 and p2, and return the positions of all items on la except these items.
Example: la=10, 20, 30, 40, 50, 60, 70, 80, 90; p1,p2 | p1,p2 | ...=15, 35, 50, 70: Result: 1, 4, 8, 9
That is, the positions of all the values that are not in the range 15->35 OR the range 50->70, inclusive.

Other definitions of range (> and <, for example) work in a similar way.

If-Then-Else (Simple) - Row O

Despite looking complicated, this is a simple If-Then-Else for two numbers being compared, a and b, with two possible resulting lists, lc and ld. This says: if a satisfies some relationship with b then the resulting list will be lc, otherwise it will be ld.

if a < b: lc, else ld

Example: a=3; b=4; lc=25; ld=50: Result=25 (as 3<4 the result is lc)

Example: a=3; b=4; lc=25, 70; ld=L0: Result=25, 70  (as 3<4 the result is lc)

Example: a=4; b=3; lc=101; ld=L0: Result=L0  (as the check for 4<3 fails the result is ld)

Other comparisons work in a similar way. 

If-Then-Else (Items) - Row P

This is an If-Then-Else for corresponding items on 4 input lists: [a], [b], [c], [d]. The length of [a] determines the length of the output, with other lists of items cycling in the usual way.

This says: if a satisfies some relationship with b then the resulting value will be c, otherwise it will be d.

if a < b: c, else d

Example: [a]=3; [b]=4; [c]=25; [d]=50: Result=25  (as 3<4 the result is c)
Example: [a]=2, 5, 4, 3; [b]=4; [c]=25, 26, 27, 28; [d]=50: Result=25, 50, 50, 28 (the 1st and 4th items on la are < 4, so the items at these positions on the result list are those from list [c], while the others are from list [d].
Example: [a]=2, 5, 4, 3; [b]=4, 2, 6, 6; [c]=25, 26, 27, 28; [d]=50:  Result=25, 50, 27, 28 

If [a]=L0, the output will be L0.

Other comparisons work in a similar way. 

Note: You can sometimes avoid using several of these linked together by using a single Case (Map Values) operation (List & List Operation).

If-Then-Else (All) - Row Q

This says: if all the items on [a] satisfy some relationship with the corresponding items on [b], then the resulting list will be lc, otherwise the resulting list will be ld. Note: lc and ld are treated as whole lists, not lists of items from which the result will be constructed.

if a < b: lc, else ld

Example: [a]=3; [b]=4; lc=25; ld=50: Result=25  (as 3<4 the result is lc)
Example: [a]=2, 5, 4, 3; [b]=4; lc=25, 26, 27, 28; ld=50: Result=50  (Two of the items failed the test, so the result is the single-item list, ld, which is 50)
Example: [a]=2, 5, 4, 3; [b]=10; lc=25, 26, 27; ld=50: Result=25, 26, 27 (All the items passed the test, so the result is the 3-item list, lc)

N.B. More strictly, the meaning is: if none of the items on [a] fail to satisfy some relationship with the corresponding items on [b], then the resulting list will be lc, otherwise the resulting list will be ld. This means that if [a]=L0, the result will always be lc, as there ar no items that can fail the specified relationship.

Other comparisons work in a similar way. 

N.B. As is shown by the first example for each of the three If-Then-Else numipulation boxes, if the four inputs contain only one number each, then their behaviours are identical, so any of them may be used for a simple number If-Then-Else.

Table Operation - Row S

The first two inputs for Table Operation are a list, la, and a number, ncols. Together these represent an input table (see Tables), where la represents the cell values and ncols represents the number of columns in the input table.

The operations defined take this input table, and produce a list of numbers, based on parameters defined in the last input list, p1,p2... p1,p2... ... . Some of the operations produce a row, column, block or cell as the result, while others produce some function of the values. 

Some of these operations require one parameter, some two, some more (the name of the operation makes this clear, as it always refers to the parameters). In all cases, more than one set of parameters may be entered; the final result list consists of the results for the first set of parameters, followed by those for the second set, and so on.

Note: The results for an empty input list, la, are described individually.

All the operations described below, except those within the Searching and Graph Plotting groups, assume that la=1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 and ncols =4, so that the input table is

1 2   3   4
5 6   7   8
9 10 11 12

Some operations also give some additional examples for la.

Row p1

This takes a single parameter, p1. The p1th row of the input table is returned as a result.

Example: p1=2: Result=5, 6, 7, 8
Example: p1=2, 1, 2: Result=5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8
Example: p1=2, 4: Result=5, 6, 7, 8, undefined  (since, although the second row exists, there is no 4th row, so the result for this parameter is returned as undefined ).

If la is an empty list, there are 0 rows, so the result is undefined .

Column p1

This takes a single parameter, p1. The p1th column of the input table is returned as a result.

Example: p1=2: Result=2, 6, 10
Example: p1=2, 1: Result=2, 6, 10, 1, 5, 9

If la is an empty list, the result is an empty list if p1 is valid, otherwise it is undefined .

Cell [row,col]=[p1,p2]

This takes two parameters, p1 and p2. The value in the cell found at the intersection of row p1 and column p2 is returned (in a list) as a result.

Example: p1,p2=2, 3: Result=7
Example: p1,p2=2, 3, 2, 1, 1, 2: Result=7, 5, 2
Example: p1,p2=2, 3, 2, 1, 1, 2, 3: Result=7, 5, 2 (the last parameter is ignored as it is surplus).
Example: p1,p2=2, 3, 1.5 , 2, 1, 2: Result=7, undefined, 2 (the second pair of parameters, 1.5, 2, are not valid row/column indices for the input table, so undefined is returned as the result for these).

If la is an empty list, the result for any pair of parameters p1 and p2 is undefined .

Block [p1,p2]->[p3,p4]

This takes four parameters, p1, p2, p3, p4. 

p1 and p2 represent the row number and column number of one cell in the table, and p3 and p4 represent the row number and column number of a second cell. Conceptually, a rectangular block is drawn around these cells, and the result is a list of the values in all the cells contained within this block (extracted row-by-row starting at the top).

Example: p1,p2,p3,p4=1, 2, 3, 4

1 2   3   4
5 6   7   8
9 10 11 12

The first cell is row 1, column 2 = the cell with 2 in it.
The second cell is row 3, column 4 = the cell with 12 in it.
The bold cells show those cells within the rectangle that surrounds these two cells, so the result is:
2, 3, 4, 6, 7, 8, 10, 11, 12

Example: p1,p2,p3,p4=3, 4, 1, 2

The same two cells are specified as in the first example, albeit in a different order, so the result is the same: 2, 3, 4, 6, 7, 8, 10, 11, 12

Example: p1,p2,p3,p4=2, 1, 2, 3

1 2   3   4
5 6   7   8
9 10 11 12

The result is 5, 6, 7

Example: p1,p2,p3,p4=2, 3, 2, 3

1 2   3   4
5 6   7   8
9 10 11 12

The result is the value in the single cell at row 2, column 3 = 7

If la is an empty list, the result for any set of parameters p1, p2, p3 and p4 (except L0) is undefined .

Swap rows p1 & p2

The result has rows p1 and p2 of la swapped in position.

Example: p1,p2=2,3. Result = 1, 2, 3, 4, 9, 10, 11, 12, 5, 6, 7, 8, i.e. the table:

1 2   3   4
9 10 11 12
5 6   7   8

Remember: For this and others below in this section, if you have two pairs of parameters, the result will not be the outcome of applying both swaps to the input list in one go, with the result length the same length as la; it will be the result for the first pair, followed by the result for the second pair (i.e. the result will be twice the length of la).

Swap cols p1 & p2

Similar to Swap rows.. but with the swapping of columns.

Example: p1,p2=2,3. Result = 1, 3, 2, 4, 5, 7, 6, 8, 9, 11, 10, 12, i.e. the table

1 3   2   4
5 7   6   8
9 11 10 12

Move row p1 to p2

The result has row p1 of la moved to become row p2 of the result. The relative ordering of the other rows remains unchanged.

Example: p1,p2=1,3. Result = 5, 7, 6, 8, 9, 11, 10, 12, 1, 3, 2, 4, i.e. the table

5 6   7   8
9 10 11 12
1 2   3   4

Move col p1 to p2

The result has column p1 of la moved to become column p2 of the result. The relative ordering of the other columns remains unchanged.

Example: p1,p2=1,3. Result = 2, 3, 1, 4, 6, 7, 5, 8, 10, 11, 9, 12, i.e. the table

2   3   1   4
6   7   5   8
10 11 9   12

Delete rows p1->p2

The result has rows p1 through to p2 of la removed. The relative ordering of the other rows remains unchanged.

Example: p1,p2=2,2. Result = 1, 2, 3, 4, 9, 10, 11, 12, i.e. the table:

1 2   3   4
9 10 11 12

Example: p1,p2=2,3. Result = 1, 2, 3, 4

Example: p1,p2=1,3. Result = L0

Delete cols p1->p2

Similar to Delete rows... The result has columns p1 through to p2 of la removed. The relative ordering of the other columns remains unchanged.

Example: p1,p2=1,2. Result = 3, 4, 7, 8, 11, 12, i.e. the table:

3   4
7   8
11 12

Look-up rows: p1

This finds the first row, moving from top to bottom, that has the value p1 as its first item (i.e. in column 1). The result is the list of all the elements in the row except for the first one.

If no row is found with the value p1 as its first item, the result is undefined.

Example: p1=5: Result=6, 7, 8
Example: p1=6, 9: Result=undefined, 10, 11, 12

If la is an empty list, the result for any value of p1 is undefined .

Look-up cols: p1

This finds the first column, moving from left to right, that has the value p1 as its first item (i.e. in row 1). The result is the list of all the elements in the column except for the first one.

If no column is found with the value p1 as its first item, the result is undefined.

Example: p1=2: Result=6, 10
Example: p1=3, 1: Result=7, 11, 5, 9

If la is an empty list, the result for any value of p1 is undefined .

Rows: @p1 < p2

This selects and returns as lists all the rows that satisfy the condition: the item in column p1 is less than the value p2. The order of the row lists in the result is determined by the input table (rows nearer to the top appear first). Note: @p1 is shorthand for 'the item at position p1'.

If no such rows are found for p1 and p2, an empty list results.
If p1 is not a valid column number, the result is undefined.

Example: p1, p2=2, 7: Result=1, 2, 3, 4, 5, 6, 7, 8 (since only in the first two rows is the second item less than 7).
Example: p1=1, 0: Result=L0 (since no rows have the first item less than 0).

If la is an empty list, the result is an empty list.

Rows: @p1 <= p2, Rows: @p1 = p2, Rows: @p1 <> p2, Rows: @p1 >= p2, Rows: @p1 > p2

These operate in a similar manner to Rows: @p1 < p2, but the comparison test is, of course, different.

Cols: @p1 < p2

This selects and returns as lists all the columns that satisfy the condition: the item in row p1 is less than the value p2.  The order of the column lists in the result is determined by the input table (columns nearer to the left appear first).

If no such columns are found for p1 and p2, an empty list results.
If p1 is not a valid row number, the result is undefined.

Example: p1, p2=2, 7: Result=1, 5, 9, 2, 6, 10 (since only in the first two columns is the second item less than 7).
Example: p1=1, 0: Result=L0 (since no columns have the first item less than 0).

If la is an empty list, the result is undefined .

Cols:@p1 <= p2, Cols: @p1 = p2, Cols: @p1 <> p2, Cols: @p1 >= p2, Cols: @p1 > p2

These operate in a similar manner to Cols: @p1 < p2, but the comparison test is, of course, different.

Rows: @p1 < @p2

This selects and returns as lists all the rows that satisfy the condition: the item in column p1 is less than the item in column p2. The order of the row lists in the result is determined by the input table (rows nearer to the top appear first).

If no such rows are found for p1 and p2, an empty list results.
If p1 or p2 is not a valid column number, the result is undefined.

Example: p1, p2=2, 3: Result=1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 (since in all rows the value in column 2 is less than the value in column 3)
Example: p1, p2=3, 2: Result=L0 (since in no rows is the value in column 3 less than the value in column 2)

If la =
4 3 5 6
1 4 2 5
6 3 7 1
3 2 4 4

and ncols=4, and p1, p2=2, 4, then the result would be 4, 3, 5, 6, 1, 4, 2, 5, 3, 2, 4, 4 (i.e. all rows except the 3rd, since the 3rd does not satisfy the condition that the 2nd element is less than the 4th).

If la is an empty list, the result is an empty list.

Rows: @p1 <= @p2, Rows: @p1 = @p2, Rows: @p1 <> @p2, Rows: @p1 >= @p2, Rows: @p1 > @p2

These operate in a similar manner to Rows: @p1 < @p2, but the comparison test is, of course, different.

Cols:@p1 < @p2, Cols:@p1 <= @p2, Cols: @p1 = @p2, Cols: @p1 <> @p2, Cols: @p1 >= @p2, Cols: @p1 > @p2

These operate in a similar manner to the corresponding Rows: operations, but search and return columns rather than rows. For example, Cols: @p1 < @p2 searches for all columns where its p1th item (i.e. in the p1th row from the top) is less than the value in its p2th item.

If la is an empty list, the result is undefined .

Sum of row p1

This takes a single parameter, p1. The sum of the values of the p1th row of the input table is returned as a result.

Example: p1=2: Result=26 (sum of 5, 6, 7, 8)
Example: p1=1, 2, 3: Result=10, 26, 42
Example: p1=2, 4: Result=26, undefined  (since although the second row exists, there is no 4th row, so the result for this parameter is returned as undefined .

If la is an empty list, the result is undefined . Why? There are no rows, so p1 is always invalid.

Sum of column p1

This takes a single parameter, p1. The sum of the values of the p1th column of the input table is returned as a result.

Example: p1=2: Result=18 (sum of 2, 6, 10)
Example: p1=1, 2, 3, 4: Result=15, 18, 21, 24

If la is an empty list, the result is 0 if p1 is a valid column, otherwise it is undefined . Why? Each valid column has no items, and the sum of an empty list is 0.

Product of row p1

This takes a single parameter, p1. The product of the values of the p1th row of the input table is returned as a result.

Example: p1=2: Result=1680 (product of 5, 6, 7, 8)
Example: p1=1, 2, 3: Result=24, 1680, 11880
Example: p1=2, 4: Result=1680, undefined  (since although the second row exists, there is no 4th row, so the result for this parameter is returned as undefined .

If la is an empty list, the result is undefined . Why? There are no rows, so p1 is always invalid.

Product of column p1

This takes a single parameter, p1. The product of the values of the p1th column of the input table is returned as a result.

Example: p1=2: Result=120 (product of 2, 6, 10)
Example: p1=1, 2, 3, 4: Result=45, 120, 231, 384

If la is an empty list, the result is 1 if p1 is a valid column, otherwise it is undefined . Why? Each valid column has no items, and the product of an empty list is 1.

Counts: p1 in rows

This takes a single parameter, p1. The result is a list of the number of occurrences of the value p1 in each of the rows of the input table.

Example: p1=2: Result=1, 0, 0 (2 occurs once in row 1 and 0 times in rows 2 and 3).
Example: p1=2, 7: Result=1, 0, 0, 0, 1, 0 (2 occurs once in row 1 and 0 times in rows 2 and 3; 7 does not appear in row 1, appears once in row 2, and does not appear in row 3).

If la is an empty list, the result is an empty list.

Counts: p1 in cols

This takes a single parameter, p1. The result is a list of the number of occurrences of the value p1 in each of the columns of the input table.

Example: p1=2: Result=0, 1, 0, 0 (2 occurs once in column 2 and 0 times in columns 1, 3 and 4).
Example: p1=2, 7: Result=0, 1, 0, 0, 0, 0, 1, 0 (2 occurs once in column 2 and 0 times in columns 1, 3 and 4; 7 does not appear in columns 1 and 2, appears once in column 3, and does not appear in column 4).

If la is an empty list, the result is a list containing ncols occurrences of 0.

Count p1 in row p2

This takes two parameters, p1 and p2. The result is the number of occurrences of the value p1 in row p2 of the input table.

Example: p1,p2=2, 1: Result=1 (2 occurs once in row 1).
Example: p1,p2=2, 1, 7, 1, 11, 3: Result=1, 0, 1 (2 occurs once in row 1; 7 does not appear in row 1; 11 appears once in row 3).

If la is an empty list, the result is an empty list.

Count p1 in column p2

This takes two parameters, p1 and p2. The result is the number of occurrences of the value p1 in column p2 of the input table.

Example: p1,p2=2, 1: Result=0 (2 occurs zero times in column 1).
Example: p1,p2=2, 1, 7, 1, 11, 3: Result=0, 0, 1 (2 does not appear in column 1; 7 does not appear in column 1; 11 appears once in column 3).

If la is an empty list, the result is 0 if p2 is a valid column, otherwise it is undefined .

Subst. p1 @ [p2, p3]

This takes three parameters p1, p2 and p3. The result list contains the items of the input table, but with the item at cell [p2, p3] (row p2, column p3) replaced by the value p1.

Example: p1,p2...= -89, 2, 3: Result=1, 2, 3, 4, 5, 6, -89, 8, 9, 10, 11, 12
Example: p1,p2...= -89, 3, 4: Result=1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, -89
Example: p1,p2...= -89, 2, 5: Result=undefined (there is no cell at row 2 column 5).

If la is an empty list, the result is undefined .

Resize p1Xp2, fill p3>

This takes three parameters p1, p2 and p3. It is concerned with producing a resized output table based on a given input table.  p1 defines the number of rows in the output table; p2 defines the number of columns in the new table; p3 defines the value to be entered in any new cells that exist in the new table but not the input table.

To explain, consider the input table:

1 2   3   4
5 6   7   8
9 10 11 12

Suppose we wish to resize it to produce an output table with 2 rows and 3 columns only. Any resizing always assumes that the top-left cell of the table (if any) will also be the top-left cell of the resized table. This resizing therefore means that we have to remove from the input table the 3rd row and the 4th column, so that we are left with:

1 2   3
5 6   7

Suppose, instead, that we wish to resize it to produce an output table with 5 rows and 5 columns. Again, the resizing assumes that the top-left cell of the table will also be the top-left cell of the resized table. This resizing therefore means that we have to add in two additional rows at the bottom and a column on the right, so that we are left with:

1 2   3   4   ?
5 6   7   8   ?
9 10 11 12 ?
? ?   ?   ?   ?
? ?   ?   ?   ?

Since the result must contain numbers, we cannot produce a table containing symbols such as a '?'. The parameter p3 is used to specify the value that is placed in every 'new' cell. So, if the three parameters were 5,5,0, the output table would be:

1 2   3   4   0
5 6   7   8   0
9 10 11 12 0
0 0   0   0   0
0 0   0   0   0

We explain this operation by saying that it produces an output table . However, the result of the operation cannot actually be a table but must be a list. The result list therefore consists of the values in the output table selected from each row (left-to-right) starting at the top. The result list may, of course, be displayed as a table in the Table Formatter.

If la is an empty list, the output table will have all its values equal to p3.

If either p1 or p2 has the value 0, the result will be an empty list (L0).

Clusters>

The operations within the Clusters group of operations are all concerned with carrying out some form of search within an input table starting from a given cell within the table, where the starting cell is defined by parameters p1 and p2, which always specify the row and column respectively of the cell.

The operations all involve starting from the starting cell and searching in all directions (both directions along the associated row and column) and, in most cases, all directions diagonally as well.

These operations might be used when looking for or analysing clusters of data in a table, or when analysing positions in a game where the cells of the table represent various states of the game.

To explain these operations, we will use the following 5X5 table (la=3, 4, 5, 4, 4, 2, 5, 4, 2, 1, 1, 5, 4, 4, 2, 2, 4, 3, 2, 1, 4, 4, 4, 2, 4 and ncols=5):

3 4 5 4 4
2 5 4 2 1
1 5 4 4 2
2 4 3 2 1
4 4 4 2 4

We will start searches from the centre cell, i.e. p1=3 and p2=3

In all these operations, the result is undefined if la is an empty list, or if p1 or p2 is not a valid row/column number.

[p1,p2]-> count p3

This operation counts the number of occurrences of the value p3 in every one of 8 directions before a value that is not p3 is found. Note: the starting cell itself is not counted.

The result list, which always contains eight items unless some error results, contains the results for the searches starting in the upwards vertical direction, which we'll call North, or N, and moving clockwise (so the last result is for the NW direction). So, the eight results are for the directions: N, NE, E, SE, S, SW, W, NW.

Example: p1,p2...=3, 3, 4: Result=1, 0, 1, 0, 0, 2, 0, 0
since there is one 4 in the N direction next to the centre cell, 0 in the NE direction, 1 in the E direction, then all other directions have no adjacent 4s except the SW direction where 2 are found, as shown in bold below:

3 4 5 4 4
2 5 4 2 1
1 5 4 4 2
2 4 3 2 1
4 4 4 2 4

[p1,p2]-> cells p3

This operation finds the occurrences of the value p3 in every one of 8 directions before a value that is not p3 is found, and returns in the result list, the row number and column number, in pairs, of the cells in which they occur. In other words, it returns the row and column numbers of all those occurrences counted up in [p1,p2]-> count p3 . Note: the starting cell itself is not included.

The pairs of row/column numbers in the result list are given in the order they are found when following the same search directions/orders as for [p1,p2]-> count p3 .

Example: p1,p2...=3,3,4: Result=2, 3, 3, 4, 4, 2, 5, 1
the 4s found are in cells [2,3], [3,4], [4,2] and [5,1].

[p1,p2]-> 1st not p3

This operation searches the same 8 directions, and in the same order, as [p1,p2]-> count p3 , but finds the first value in each direction that is not equal to p3. If no such value is found, undefined is returned for that direction. Note: the starting cell itself is not included.

Example: p1,p2...=3, 3, 4: Result=5, 2, 2, 2, 3, undefined, 5, 5.

[p1,p2]-> linked +x

This operation carries out a search starting at the start cell [p1, p2] and returns in the result list a set of numbers representing pairs of row/column numbers of all the cells that have the same value as the start cell and are linked to it, either horizontally, vertically or diagonally, by cells that also have the same value as the start cell. That is, it returns the row/column numbers of all cells in the cluster of cells with the same value as the start cell where a path can be traced back to the start cell that includes cells containing only the value of the start cell. Note: the starting cell itself is included as the first pair of row/column pair.

Example: p1,p2...=3, 3: Result=3, 3, 2, 3, 3, 4, 4, 2, 5, 1, 1, 4, 1, 2, 5, 3, 5, 2, 1, 5. This represents the set of cells: [3, 3], [2, 3], [3, 4], [4, 2], [5, 1], [1, 4], [1, 2], [5, 3], [5, 2], [1, 5] as highlighted in the table below:

3 4 5 4 4
2 5 4 2 1
1 5 4 4 2
2 4 3 2 1
4 4 4 2 4

Note that the 4 in the bottom-right cell does not form part of this cluster, as there is no path linking it to the start cell formed of cells containing only 4s.

In case the order is important, the start cell row/column pair comes first, then the row/column pairs for the cells found by a [p1,p2]-> cells p3 type of search starting here, then the row/column pairs for any new cells found as a result of a similar search from each cell found, and so on.

Note that the +x in the operation name represents the fact that this search finds links horizontally, vertically and diagonally.

[p1,p2]-> linked +

This operation carries out a search starting at the start cell [p1, p2] and returns in the result list a set of numbers representing pairs of row/column numbers of all the cells that have the same value as the start cell and are linked to it, either horizontally or vertically, diagonal links ignored, by cells that also have the same value as the start cell. That is, it returns the row/column numbers of all cells in the cluster of cells with the same value as the start cell where a horizonal/vertical path can be traced back to the start cell that includes cells containing only the value of the start cell. Note: the starting cell itself is included as the first pair of row/column pair.

Example: p1,p2...=3, 3: Result=3, 3, 2, 3, 3, 4. This represents the set of cells: [3, 3], [2, 3], [3, 4] as highlighted in the table below:

3 4 5 4 4
2 5 4 2 1
1 5 4 4 2
2 4 3 2 1
4 4 4 2 4

Note that none of the other 4s in the table have horizontal/vertical paths linking them to the start cell formed of cells containing only 4s.

The order of the results is similar to that for [p1,p2]-> linked +x .

Note that the + in the operation name represents the fact that this search finds links only horizontally or vertically, not diagonally.

Graph Plotting

The Graph Plotting operations are concerned with providing results which, given appropriate formatting, can provide rudimentary graphical representations of some input data.

Each operation is best described by considering that it produces an output table . However, the result of the operation cannot actually be a table but must be a list. The result list therefore consists of the values in the output table selected from each row (left-to-right) starting at the top. The result list may, of course, be displayed as a table in the Table or Graphics Formatter.

Plot p1 (p2) vs p3 (p4)

This takes four parameters: p1 through to p4. It is a complex operation to explain and understand and is used as a basis for producing a plot of column p1 (on the vertical- or Y-axis) vs column p3 (on the horizontal- or X-axis), each containing numbers that may be real or integers. To produce such plots, it is necessary to group, or normalize, the values in the two lists in some way, which we do here by assigning the values to certain specified ranges or blocks.

The first two, p1 and p2, together define a list of numbers to be mapped to a certain number of equal-sized blocks between the minimum and maximum values of the list of numbers. p1 is the column number of the input table, whose values form the list of numbers, while p2 is a positive integer representing the number of blocks to which these numbers are to be mapped. See List Operation (Row J) Map to p1 blocks for a full description of this mapping (but remember that the 'p1' in that represents the number of blocks, whereas here the number of blocks is represented by parameter p2).

The second two, p3 and p4, represent respectively a second column and associated number of blocks to which the numbers in the column are to be mapped.

To help understand this operation, consider that this operation produces an output table, with p2 rows and p4 columns. Corresponding items on the two sets of equal length mappings (the first containing integers ranging from 1 to p2, the second containing integers ranging from 1 to p4) are taken to specify cells in the output table. The values in the output table represent the number of pairs that specify the given cell. The result, is, of course, just the values of the output table laid out as a list in the usual way.

Example:

Suppose la contains is the list 2, 4, 5, 6, 1, 10, 6, 9, 4, 5, 11, 7, 2, 4, 0, 4, 2, 4, 6, 9 and ncols is 2. The input table is therefore:

2 4.1
5 6
1 10
6 9
4 5.1
11 7
2 4.2
0 4
2 4
6 9

If p1=1, p2=6, p3=2 and p4=4, the two sets of mappings (shown as columns), after mapping the values in the first column to integers 1 -> 6 and those in the second column to 1 -> 4 (in both cases the minimum value maps to 1) are:

2 1
3 2
1 4
4 4
3 1
6 3
2 1
1 1
2 1
4 4
 

The output table, where row 1 is at the top, as usual in Numipulator, and column 1 is on the left, is therefore:

1 0 0 1
3 0 0 0
1 1 0 0
0 0 0 2
0 0 0 0
0 0 1 0

and the result list is 1, 0, 0, 1, 3, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0

This says that there is only 1 pair of corresponding items that map to cell [1, 1], 3 that map to cell [2, 1], 0 that map to cell [2, 2], and so on.

This could form the basis of a rudimentary plot of column 1 vs column 2, although you would probably wish to flip the table vertically, so that the lowest values on the vertical axis are on the bottom row rather than the top row.

If la is an empty list, the result is undefined .

Histogram p1 (p2)

This takes two parameters: p1 and p2. It is concerned with producing an output table which, when formatted appropriately, represents a rudimentary histogram.

p1 is the number of a column in the input table. The numbers in this column generally represent a count of the occurrence (or frequency) of some factor in a population. The numbers in the column should all be non-negative numbers.

p2 is the number of rows in the output table in which the histogram should be presented.

To explain, suppose we have an input table consisting of just one column as follows (where la=7, 11, 8, 2, 6, 10, 0, 9 and ncols=1)

7
11
8
2
6
10
0
9

Suppose these numbers represent the numbers of people in a small survey that read certain newspapers (7 read paper1, 11 read paper2, and so on). We might want to look at these data graphically in the form of a histogram. If we therefore carry out a calculation with p1=1 (i.e. the first column) and p2=6, the output table would have 6 rows (as defined by p2) and 8 columns (the number of data items in the column) and would look as follows:

7 11 8 2 6 10 0 9
7 11 8 0 6 10 0 9
7 11 8 0 6 10 0 9
7 11 8 0 0 10 0 9
0 11 0 0 0 10 0 9
0 11 0 0 0 0 0 0

If you mentally ignore the 0s (or physically remove them), the table looks as follows:

7 11 8 2 6 10   9
7 11 8   6 10   9
7 11 8   6 10   9
7 11 8     10   9
  11       10   9
  11            

you will see that this table contains a number of downward-pointing column bars where the 'length' of the column bar is roughly proportional to the number of people that read each paper. The actual number reading it is given by the number making up the bar.

The output table is produced as follows:

  • the number of rows in the output table = p2;
  • the number of columns in the output table = the number of values in the input column;
  • each of the columns in the output table is associated with the corresponding value in the input column;
  • the interval for each row = (the maximum value in the input column/p2) rounded up; so, in the example, the interval of each row is 11/6 rounded up = 2;
  • each row has a lower limit = (row number-1)Xinterval; so, in the example, row 1 (the top row) has a lower limit=0, row 2 has a lower limit = 2 and row 6 has a lower limit = 10.
  • for each cell, if the value associated with the column > (but not equal to) the lower limit of its row, its value is the value associated with the column; otherwise it is 0.

If la is an empty list, the result is undefined .

Meta Ops

The Meta Ops operations provide the ability to specify the function or operation to be carried out on a table by means of a code. There are five of these:

  • Function=p0
  • Op=p0:p1
  • Op=p0:p1,p2
  • Op=p0:p1,p2,p3
  • Op=p0:p1,p2,p3,p4

In all cases, p0 represents the code for the function or operation, while the remaining parameters (if any) represent the parameters of the operation specified by the code. The codes can be found by clicking on the Codes link near the top of the main Numipulator page.

Please note the following carefully, as an example: Op:p0:p1,p2,p3 has a total of 4 parameters: the first, p0, represents the number code of the operation, which can be found under Table Operations - 3 parameters: in the list of Codes. The remaining three, p1, p2 and p3 correspond to p1, p2, p3 in the description of the operation above.

In the following examples, the input table is a 4-column table:

1 2   3   4
5 6   7   8
9 10 11 12

Example: Operation selected is Func=p0; parameter(p0)=15
Op Code 15 under Table Functions means Shift rows up so the result will be:

5 6   7   8
9 10 11 12
1 2   3   4

Example: Operation selected is Op(p1):p2,p3; parameters (p0, p1, p2)=2,2,3
Op Code 2 under Table Operations - 2 parameters means Swap rows p1 & p2 so the result will have rows 2 and 3 swapped:

1 2   3   4
9 10 11 12
5 6   7   8

Table Function - Row T

This takes a list, la, and a number, ncols, as inputs. Together these represent an input table (see Tables), where la represents the cell values and ncols represents the number of columns in the input table.

The functions include many Transformations. These take this input table, which has both shape and values, and produce an output table. The shape of the output table is, depending on the Transformation function, either the same as the input table, i.e. with ncols columns, or else that shape turned through 90 degrees, i.e. with ncols rows.  The values in the cells are dependent on the Transformation function.

The result list for the functions that are Transformations consists of the values in the output table selected from each row (left-to-right) starting at the top. So, for example, if the output table were:

4 3 5 6
2 1 8 5
4 2 1 7

the result list would be 4, 3, 5, 6, 2, 1, 8, 5, 4, 2, 1, 7

The result list for the functions that are Other represents some property of the output table, e.g. the ranks of the columns when the table is sorted according to its columns.

Note: The results for an empty input list, la, are described below for all functions.

All the functions described below, except the Sort... , Shift... , Permutation... , Ranks..., and Remove duplicates functions, assume that la=1, 2, 3, 4, 5, 6 and ncols =3, so that the input table is

1 2 3
4 5 6

Transformations

For all the Transformation functions, if la is an empty list and ncols is a positive integer, the result is an empty list.

Transpose row/col

Rows and columns are swapped around, so that the top row becomes the leftmost column, the second row becomes the second column, and so on.  Note: the output table has ncols rows.

1 4
2 5
3 6

Flip horizontally

The leftmost column of the input table becomes the rightmost column of the output table, the second column becomes the second-to-right column of the output table, and so on. The output table has ncols columns.

3 2 1
6 5 4

Flip vertically

The top row of the input table becomes the bottom row of the output table, the second row becomes the second to bottom row of the output table, and so on. The output table has ncols columns.

4 5 6
1 2 3

Rotate 90 degs

The input table is turned 90 degrees clockwise. The output table has ncols rows.

4 1
5 2
6 3

Rotate 180 degs

The input table is turned 180 degrees clockwise. The output table has ncols columns.

6 5 4
3 2 1

Rotate 270 degs

The input table is turned 270 degrees clockwise. The output table has ncols rows.

3 6
2 5
1 4

Sort... functions

The Sort... functions are all concerned with sorting the rows or columns. In all cases, the shape of the output table is the same as the input table, with ncols columns. To explain these, an input table with la=

4 3 2 2
2 1 8 8
4 2 1 1

and ncols=4 is used for the examples.

Sort rows (asc)

This function sorts the rows in ascending order (from top to bottom), where the primary key is the value in the first column. If the values in the first column are identical, then the values in the second column are used as a secondary key. This pattern continues, if necessary, for all columns.

So, the output list (shown as a table here) is:

2 1 8 8
4 2 1 1
4 3 2 2

Note: Because the items is the first column (the primary key) of 4 2 1 1 and 4 3 2 2 are identical, the items in the second column (the secondary key) are used to determine the order. This results in 4 2 1 1 being considered less than 4 3 2 2.

Sort rows (desc)

This is similar to Sort rows (asc) but the rows are placed in descending order top to bottom. The output list (shown as a table) is:

4 3 2 2
4 2 1 1
2 1 8 8

Sort cols (asc)

This sorts the columns in ascending order from left to right, where the primary key is the value in the first row. If the values in the first row are identical, then the values in the second row are used as a secondary key. This pattern continues, if necessary, for all rows.

The output list (shown as a table) is:

2 2 3 4
8 8 1 2
1 1 2 4

Sort cols (desc)

This is similar to Sort cols (asc.) but the columns are placed in descending order left to right. The output list (shown as a table) is:

4 3 2 2
2 1 8 8
4 2 1 1

Sort ind. rows (asc)

This function sorts the values in each of the individual rows in ascending order.

So, the output list (shown as a table here) is:

2 2 3 4
1 2 8 8
1 1 2 4

Sort ind. rows (desc)

This function sorts the values in each of the individual rows in descending order.

So, the output list (shown as a table here) is:

4 3 2 2
8 8 2 1
4 2 1 1

Sort ind. cols (asc)

This function sorts the values in each of the individual columns in ascending order.

So, the output list (shown as a table here) is:

2 1 1 1
4 2 2 2
4 3 8 8

Sort ind. cols (desc)

This function sorts the values in each of the individual columns in descending order.

So, the output list (shown as a table here) is:

4 3 8 8
4 2 2 2
2 1 1 1

Shift... functions

The Shift... functions are all concerned with shifting rows or columns by one row/column in a certain direction. In all cases, the shape of the output table is the same as the input table, with ncols columns. To explain these, the same input table as for the Sort... functions above will be assumed.

Shift rows up

The output list (shown as a table here), where row 2 has become row 1, row 3 has become row 2 and row 1 has moved to the end, is:

2 1 8 8
4 2 1 1
4 3 2 2

The other Shift... functions operate in a similar way

Permutation: Rows

The individual rows remain intact, but their relative positions change pseudo-randomly. One possible result, using the same input table as for the Sort... functions, is:

4 2 1 1
2 1 8 8
4 3 2 2

Permutation: Cols

This operates similarly, but pseudo-randomly re-orders the column positions.

Rows bottom-right  (and similar operations)

The four functions Rows top-left, Rows top-right, Rows bottom-right, and Rows bottom-left all have an output table the same shape as the input table, i.e. with ncols columns. They specify that the values in the original input list, la, should be entered into the output table in rows, starting at the specified cell. Each row is filled in the same direction - the direction being dictated by the starting cell.

Reminder: All the functions concerned with laying out the values in a particular way assume an input table as follows:

1 2 3
4 5 6

So, Rows bottom-right yields the follow output table:

6 5 4
3 2 1

Notes: 
Rows bottom-right is the same transformation as Rotate 180 degs. 
Rows top-right is the same transformation as Flip horizontally. 
Rows bottom-left is the same transformation as Flip vertically.

Cols bottom-right (and similar operations)

The four functions Cols top-left, Cols top-right, Cols bottom-right, and Cols bottom-left all have an output table the same shape as the input table, i.e. with ncols columns. They specify that the values in the original input list, la, should be entered into the output table in columns, starting at the specified cell. Each column is filled in the same direction - the direction being dictated by the starting cell. So, Cols bottom-right yields the follow output table:

6 4 2
5 3 1

S-Rows bottom-right  (and similar operations)

The four functions S-Rows top-left, S-Rows top-right, S-Rows bottom-right, and S-Rows bottom-left all have an output table the same shape as the input table, i.e. with ncols columns. They specify that the values in the original input list, la, should be entered into the output table in rows, starting at the specified cell. In contrast to the basic Rows transformations, alternate rows are laid out in opposite directions, so that the values from the list snake (hence the S) through the table. So, S-Rows bottom-right yields the follow output table:

4 5 6
3 2 1

S-Cols bottom-right (and similar operations)

The four functions S-Cols top-left, S-Cols top-right, S-Cols bottom-right, and S-Cols bottom-left all have an output table the same shape as the input table, i.e. with ncols columns. They specify that the values in the original input list, la, should be entered into the output table in columns, starting at the specified cell. In contrast to the basic Cols transformations, alternate columns are laid out in opposite directions, so that the values from the list snake (hence the S) through the table. So, S-Cols bottom-right yields the follow output table:

6 3 2
5 4 1

Other

Reminder: All the functions described below, except the Ranks..., and Remove duplicates functions assume an input table as follows:

1 2 3
4 5 6

Number of rows

This function produces a list with a single number in it: the number of rows in the table. For the example, the result would be the list: 2.

Numbered rows

This produces a table with an additional column on the left containing the row numbers.

1 1 2 3
2 4 5 6

Numbered cols

This produces a table with an additional row at the top containing the column numbers.

1 2 3
1 2 3
4 5 6

If la is an empty list, the result is the column numbers for ncols.
For example, if la=L0 and ncols=3, the result is 1,2,3. Why? Although the list is empty, the table still has a certain number of columns, which can be numbered.

Numbered rows/cols

This produces a table with an additional column on the left containing the row numbers, and an additional row at the top containing a 0 followed by the column numbers (as above).

0 1 2 3
1 1 2 3
2 4 5 6

If la is an empty list, the result is a 0 followed by the column numbers for ncols.
For example, if la=L0 and ncols=3, the result is 0,1,2,3.

Head: 1st row

This produces a list containing just the items of the 1st row. The result for the example is:

1 2 3

Tail: all but 1st row

This produces a list all the items of the table except for the 1st row. The result for the example is:

4 5 6

Sums of rows

This function produces a list of the sums of each of the rows. The result for the example is:

6, 15.

If la is an empty list, the result is an empty list. Why? There are no rows so no row totals

Sums of cols

This function produces a list of the sums of each of the columns. The result for the example is:

5, 7, 9.

If la is an empty list, the result is a list of length ncols, each item having a value=0. Why? There are ncols columns, each with zero items, so the total of each column is zero.

Ranks ... functions

The Ranks... functions are all concerned with sorting the rows or columns and returning, as a list, the ranks of the rows or columns in the input table. Note: if two or more of the rows or columns (as appropriate) are identical, their ranks will also be identical. If, for example, there are 3 identical rows or columns ranked 4th, the ranks 5 and 6 will not appear in the output list; the next rank (if any) will be 7.

To explain these functions, an input table with la=

4 3 2 2
2 1 8 8
4 2 1 1

and ncols=4 is used for the examples.

Ranks rows (asc)

This function considers the table that would result from sorting the rows in ascending order (from top to bottom), namely:

2 1 8 8
4 2 1 1
4 3 2 2

The result of the function is a list of the rankings of each of the input table rows (i.e. the positions of the rows from the input table as found in the sorted table). In this example, the list returned is therefore 3, 1, 2 as the 1st row of the input table is the 3rd row of the sorted table, the 2nd row of the input table is the 1st row of the sorted table, and so on.

If la is an empty list, the result an empty list. Why? There are no rows so no row rankings.

Ranks rows (desc)

This is similar to Ranks rows (asc) but the rows of the output table are placed in descending order top to bottom. The result is:

1, 3, 2

Ranks cols (asc)

This is similar to Ranks rows (asc) but in this case it considers the table that would result from sorting the columns in ascending order (left-to-right), namely:

2 2 3 4
8 8 1 2
1 1 2 4

The result is therefore:

4, 3, 1, 1

Note: there are two identical columns, both = 2, 8, 1, so both are ranked 1 (the lowest). There is therefore no column in the input table ranked 2.

If la is an empty list, the result is a list of length ncols, each value on the list = 1. Why? There are ncols columns, each having zero items, so each column is identical so each has a rank of 1.

Ranks cols (desc)

This is similar to Ranks cols (asc.) but the columns are placed in descending order left to right. The result (showing a joint 3rd rank) is:

1, 2, 3, 3

Remove duplicate rows

If the input table contains duplicate rows, all but the first of these (top-to-bottom) are deleted.

For example, if the input table (written as a table with ncols=2) were:

3 4
2 3
1 2
2 3
7 6
1 2
2 3

then the lower rows with values 2, 3 and 1, 2 would be removed and the output table would be:

3 4
2 3
1 2
7 6

and so the result would be 3, 4, 2, 3, 1, 2, 7, 6.

If la is an empty list, the result is an empty list.

Remove duplicate cols

If the input table contains duplicate columns, all but the first of these (left-to-right) are deleted.

For example, if the input table (written as a table with ncols=8) were:

2 3 4 3 5 1 2 2
1 4 7 4 6 1 1 9

then the output table would be:

2 3 4 5 1 2
1 4 7 6 1 9

and so the result would be 2, 3, 4, 5, 1, 2, 1, 4, 7, 6, 1, 9.

If la is an empty list, the result is an empty list.

Table Construction - Row U

The first two inputs for Table Construction are a list, la, and a number, ncols. Together these represent an input table (see Tables), where la represents the cell values and ncols represents the number of columns in the input table.

Merge table lc @ col d

This is concerned with simple merging of two tables, each with the same number of rows. List lc specifies the values of the table to be merged in, laid out in the usual way (left-to-right for each row of the table). The value d specifies the column at which this is to be merged in.

The simplest merge is where table given by lc is placed to the right of the table defined by la and ncols. That is, the first column of the table given by lc becomes the ncols+1th column of the resulting table.

So, if la = 1 2 3 4 5 6 7 8 9 10 11 12 and ncols=4, then the input table is:

1 2 3 4
5 6 7 8
9 10 11 12

which has 3 rows.

If lc is specified as 20 21 22 23 24 25 26 27 28, then the table to be merged, which is assumed to have 3 rows, is

20 21 22
23 24 25
26 27 28

If the value of d is specified as 5 (ncols+1), then the resulting table is:

1 2 3 4 20 21 22
5 6 7 8 23 24 25
9 10 11 12 26 27 28

with the resulting list just being the values extracted from this table in the usual way:
1 2 3 4 20 21 22 5 ... 27 28.

If d is specified as 1, then the table given by lc becomes the 1st column of the resulting table, i.e. the table given by lc is placed to the left of the main input table:

20 21 22 1 2 3 4
23 24 25 5 6 7 8
26 27 28 9 10 11 12

If d is specified as 3, then the table given by lc becomes the 3rd column of the resulting table, i.e.

1 2 20 21 22 3 4
5 6 23 24 25 7 8
9 10 26 27 28 11 12

Line Change

Each of the Line Change operations takes the input table, and constructs an output table . The operations are all concerned with inserting additional sets of row or column values, possibly associated with deletion/replacing of existing rows or columns.

The remaining two inputs are a list, lc, which represent a set of values that are to be put into the table in some way, and d, a number, which represents a row or column number in the table. In all cases, the number of values in lc must correspond to a whole number of rows or columns, as appropriate for the operation. If not, an error results.

The result list consists of the values in the output table selected from each row (left-to-right) starting at the top.

Note: The results for an empty input list, la, are described below for all operations.

The examples for the operations described below assume that la=1, 2, 3, 4, 5, 6 and ncols =3, so that the input table is

1  2  3
4  5  6

Insert lc @ row d

This inserts the additional rows defined by the values in lc in the table, with the first of these additional rows becoming the dth row of the output table.

Example: lc = 7, 8, 9, 10, 11, 12 and d = 2

Output table:
1  2  3
7  8  9
10 11 12
4  5  6

Example: lc = 7, 8, 9, 10, 11, 12 and d = 1

Output table:
7  8  9
10 11 12
1  2  3
4  5  6

Example: lc = 7, 8, 9, 10, 11, 12 and d = 3 (although the input table has only 2 rows, d=3 is a valid input which indicates that the new rows should be inserted after the existing rows, i.e. the first one is row 3 of the output table).

Output table:
1  2  3
4  5  6
7  8  9
10 11 12

This is a useful function to insert a list of arbitrary length into another list at a given position, by defining ncols=1. For example, if lc = 1, 2, 3, 4, 5, ncols=1, lc=7, 8, 9 and d=3, the result is 1, 2, 7, 8, 9, 3, 4, 5

If la is an empty list, the result is lc (assuming the length of lc corresponds to the number of columns) if d=1, otherwise it is undefined .

Del. row d & insert lc

This firstly deletes the existing row d of the input table, then inserts the additional rows defined by the values in lc in the table, with the first of these additional rows becoming the dth row of the output table.

Example: lc = 7, 8, 9, 10, 11, 12 and d = 2
Output table:
1  2  3
7  8  9
10 11 12

Example: lc = 7, 8, 9, 10, 11, 12 and d = 1
Output table:
7  8  9
10 11 12
4  5  6

Example: lc = 7, 8, 9, 10, 11, 12 and d = 3  
This produces an error, as there is no 3rd row in the input table

Example: lc = L0 and d = 1
Output table:
4  5  6

This deletes the first row and inserts an empty list, i.e. no rows.  Using an empty list as input lc is a way of deleting a given row.

If la is an empty list, the result is undefined . Why? There are no rows, so none can be deleted.

Subst. lc @ row d

Starting at row d of the input table, the rows defined in lc are entered into the table. These rows are substituted for (i.e. replace) the corresponding rows in the input table (assuming they exist).

Example: lc = 7, 8, 9, 10, 11, 12 and d = 1

Output table:
7  8  9
10 11 12
(rows 1 and 2 of the input table are replaced by the rows defined in lc)

Example: lc = 7, 8, 9, 10, 11, 12 and d = 2

Output table:
1  2  3
7  8  9
10 11 12
(row 2 of the input table is replaced, but the second row of lc is appended to the end of the table, as there is no corresponding row to replace)

Example: lc = 7, 8, 9, 10, 11, 12 and d = 3 (although the input table has only 2 rows, d=3 is a valid input which indicates that the new rows should be placed after the existing rows, i.e. the first one is row 3 of the output table - and there are no rows to replace).

Output table:
1  2  3
4  5  6
7  8  9
10 11 12

Example: lc = L0 and d = 1

Output table:
1  2  3
4  5  6
(No rows to insert, so none to replace/delete).

If la is an empty list, the result is lc (assuming the length of lc corresponds to the number of columns) if d=1, otherwise it is undefined .

Insert lc @ col d

This inserts the additional columns defined by the values in lc in the table, with the first of these additional columns becoming the dth column of the output table.

Example: lc = 7, 8, 9, 10 and d = 2

Output table:
1  7 9 2  3
4  8 10 5  6

Important: Remember that the list lc in this and the other 'col' operations defines a sequence of column values laid out top to bottom. So, the two sets of column values are 7, 8 and 9, 10 (not 7, 9 and 8, 10 as you might be tempted to think). N.B. This is quite different from Merge table lc @ col d.

The other 'col' operations, Del. col d & insert lc and Subst. lc @ col d, operate in a similar way to the 'row' operations, but on columns instead of rows.

For all the 'col' operations, if la is an empty list and lc is an empty list and d is a valid column number, the result an empty list, otherwise it is undefined . Why? The length of a column on the input table is 0, so all columns inserted or substituted must also have 0 length.

Cell Change

Cell Change operations take the input table and produce an output table that has the same size and shape as the input table, but with some of the individual cell values changed. The inputs lc and d have different meanings from the Line Change operations.

The result list consists of the values in the output table selected from each row (left-to-right) starting at the top. 

Change cell values

The input lc represents a list of parameters. These parameters are in groups of three, where the first represents a row number, the second represents a column number and the third represents a value. Any number of groups of three parameters may be specified in lc. Note: if the number of parameters is not a multiple of three, any surplus ones are ignored.

The input d is a simple number.

The way this operation operates is that each group of three parameters (rownum, colnum, val) is taken in turn. The value of the cell at [rownum, colnum] is changed as follows:
if its current value is currentval, its new value becomes: currentval*d + val

The combination of val and d enable us to make different types of change to the values:

  • if d = 0, then the current value is replaced by val
  • if d = 1, then the current value is increased by val
  • if val=0, then the new value is d times the current value

The examples below assume that la=1, 2, 3, 4, 5, 6 and ncols =3, so that the input table is

1  2  3
4  5  6

Example: lc=2, 1, 5; d=2

The output table becomes

1  2  3
13 5  6

since the new value of the cell at row 2 column 1 becomes 4X2+5, i.e. 13

Example: lc=2, 1, 5, 1, 3, 6; d=2

The output table becomes

1  2  12
13 5  6

since the new value of the cell at row 2 column 1 becomes 4X2+5, i.e. 13, and the new value of the cell at row 1 column 3 becomes 3X2+6, i.e. 12

Example: lc=2, 1, 5, 2, 1, 6; d=2

The output table becomes

1  2  3
32 5  6

since the new value of the cell at row 2 column 1 first becomes 4X2+5, i.e. 13, and then it is changed again to become 13X2+6, i.e. 32

Example: lc=2, 1, 5, 1, 3, 6; d=0

The output table becomes

1  2  6
5  5  6

since, as d=0, the new value of the cell at row 2 column 1 becomes 5, and the new value of the cell at row 1 column 3 becomes 6

Note: if any set of three parameters includes an invalid cell specification, the result is undefined . So, if la is an empty list, any changes specified in lc will result in undefined .

Change block values

This is concerned with changing the values of a block of items in a table. The input lc represents sets of parameters and values. The first 4 numbers in any set represent:

  • the row number of the item at one corner of the block,
  • the column number of the item at this corner of the block,
  • the row number of the item at the opposite corner of the block,
  • the column number of the item at that corner of the block.
Together, these imply the number of values to be changed. The remaining numbers in the set are the values to be used in the change.

One set of parameters/values follows on immediately from the preceding set. These may specify changes to values already changed by a preceding set of parameters.

Note: if there are 4 or fewer surplus numbers in lc, these are ignored; however, a set of 5 or more numbers is assumed to form a set of parameters/values. These must specify correct row and column numbers, and include the number of values implied, otherwise the output is undefined.

The input d is a simple number, and is used to specify the change to be made in exactly the same way as for Change cell values .

The examples use the same input table as above:

1  2  3
4  5  6

and assume d=0 (simple replacement). For lc, we show the values separated from the block parameters by a colon, and sets of these are on new lines. This is to help reading, but is, of course, not essential.

Example: lc=
1, 2, 2, 3 : 71, 72, 73, 74

The output table becomes

1  71  72
4  73  74

Example: lc=
1, 2, 2, 3 : 71, 72, 73, 74
2, 1, 2, 2 : 87, 88

The output table becomes

1  71  72
87  88  74

where the value 73 replaced 5, but this in turn was replaced by 88.

Items Operation - Row V

This takes two lists of items as inputs, [a] and [b], and produces a list as its result (the same length as [a]).  For each item, a, on [a], and its corresponding item, b, on list [b] (which cycles in the standard Numipulator way), the selected operation is carried out as specified in Number Operation, and a corresponding item is generated on the result list.

Add: a+b (as an example)

Example: [a]=2, 4, 5, 7; [b]=7; Result=9, 11, 12, 14.   
Example: [a]=2, 4, 5, 7; [b]=7, -2, 3, 8: Result=9, 2, 8, 15

Items Function - Row W

This takes a list of items as input, [a], and produces a list as its result (the same length as [a]). For each item, a, on [a], the selection operation is carried out as specified in Number Function, and a corresponding item is generated on the result list.

Square (as an example)

Example: [a]=2, 4, 5, 7; Result=4, 16, 25, 49. 
Example: [a]=-2; Result=4

User-defined Operation - Row X

These numipulation boxes have no pre-defined operations for you to select. Instead, you can define your own operations in the Operation field - the field that is normally a drop-down menu, but in this case is a simple text field.

There are three input fields. The first two, [a] and [b] are item lists. The third, lc, is a simple list.

Overall, the operation acts as an items operation on the corresponding items of the first two input fields, so the number of items in the result is wholly dependent on the number of items in list [a]. The items in [b] are cycled in the usual way.

The user-defined operation may refer to the corresponding items in the two item lists, through two variables: a , and b . This means that you can specify that the result item for any pair of corresponding items should be some complex relationship of the two items, e.g. 2 * a * b + a - b .

In addition, however, you are able to employ some special variables and functions that provide you with a powerful computational tool.

Firstly, you may refer to elements or properties of the third list, lc. This is done through the use of

  • a variable, lclength , which has a value equal to the number of items in lc;
  • single-argument functions that refer to the elements of the list, e.g. lc(2) , which has the value of the second item of lc;
  • two-argument functions that return numbers representing some property of a part of lc, e.g. lcsum(2, 6) , which has the value of the sum of the elements 2 through to 6 of lc.

Secondly, you may refer to properties of the set of item operations through the use of

  • a variable, n , which has a value equal to the total number of item operations in the set, which is equal to the number of items in list [a], i.e. the length of list a.
  • a variable, i , which refers to the index of the particular item operation being undertaken (i.e. we are dealing with the i th pair of items from the total number, n) .

So, if the list [a] has three items, 11, 15, 17, and list [b] has three items 5, 6, 7, then

  • when calculating the first result in the list of results, a=11, b=5, i=1 and n=3;
  • when calculating the second result in the list of results, a=15, b=6, i=2 and n=3;
  • when calculating the third result in the list of results, a=17, b=7, i=3 and n=3;

These two variables in effect allow you to handle item-by-item operations with any number of lists - not just the two [a] and [b]. For example, you could specify the value of lc to be E1, E2, where E1 and E2 are two lists with the same number of items as [a]. You can then define an expression that includes terms: a, b, lc(i), lc(n+i), where the last two refer to the corresponding items of E1 and E2.

Thirdly, you may refer to a variable, p , which has the value of the result from the previous item operation. That is, if a calculation is being carried out on the i th pair of items, then p has the value of the result of the calculation on the i-1 th pair of items. Clearly, for the first items in [a] and [b] there is no previous result. In this case, the value of p is defined as the first item of list lc, i.e. lc(1) .

To explain this, suppose you wished to calculate how much money you would have at the end of each period, starting with a certain amount, say 1000, if the interest rate varied each period, and you re-invested the interest (so you're dealing with compound interest). The intention, therefore, is to produce a list of total amounts at the end of each year. Probably the easiest way to think about this is that the total at the end of any year = (total at end of previous year) + R% of this total, where R is the interest rate over that period. To produce this using a user-defined operation, enter the list of interest rates for each period in [a], say 4, 5, 4, 5, 6; enter any value in [b] (it's not used - see below); and enter the initial amount, say 1000, in lc. The operation is then the simple expression p + (p * a/100). This produces the set of results (rounded to 2 decimal places): 1040, 1092, 1135.68, 1192.46, 1264.01.

The user-defined operation may refer to any, all, or none of these variables and functions; however, as in all other numipulation boxes with operations, all the input fields must be defined. So, even if your operation does not refer to all these input fields (or even any), all of them must be defined. This means that you should enter values in all three fields, even if you don't intend to make use of or refer to these values; just enter the value 1 in any field you don't refer to.

The user-defined operation should be a numerical Expression, which is evaluated for each set of corresponding items on the two item lists. Enter your own numerical Expression consisting of:

a) Numbers (including integers, decimals and e-notation numbers)
Examples: 32, 32.14, 24.3e-1

b) Constants :
pi - representing π, approx. 3.142
e (the base of natural logarithms), approx. 2.718

c) Variables (referring to the three input fields): a, b, i, n, p, lclength

d) Unary minus : -  Unary minus can be applied to numbers, constants, variables, functions or any numerical expression in parentheses (but not between any functor, including if , and its associated opening parenthesis) to represent -1 times the specified value. There must be no space between the sign and the expression it is being applied to.
Examples: -a, -32, -sin(0.5), -(2*3), -(4*a), -pi

e) Operations

These take the form: Expression Operator Expression .....(spaces between these are optional) and result in a number value.
Any number of Operator Expression instances may follow the first.

Operators are given below. In each case, the meaning of the operation can be found by referring to the specified definition under Number Operation - Row A .
Operators are:
+ : Add
- : Subtract
* : Multiply
x : Multiply
/ : Divide
div : Div
mod : Mod
^ : Power
** : Power

Operators have associated precedence values, or binding values: the higher the precedence, the closer the binding in expressions. The operations containing operators with the higher precedence or binding are evaluated first; those with operators of the same precedence are evaluated left-to-right. The operator precedence values are:

Precedence 1: +, -
Precedence 2: *, x, /, div, mod
Precedence 3: ^, **

So,
2 - 4 - 3 is equivalent to (2 - 4) - 3  (value=-2 - 3= -5) since the two - operators have the same precedence, so the first operation met from left to right is evaluated first, and this value becomes the first argument of the second operation.
2 - 4 * 3 is equivalent to 2 - (4 * 3) (value=2 - 12= -10) since * has a higher precedence than -, so the (4 * 8) operation is evaluated first and used as the second argument of the Subtract operation.
2 - 4 * 3 ^ 2 - 1 is equivalent to (2 - ( 4 * ( 3 ^ 2))) - 1 (value=(2 - (4 * 9)) - 1=(2 - 36) - 1= -34 - 1= -35)

Note: Parentheses (round brackets: '(' and ')') may be used to override default precedence or to clarify meaning. Use parentheses if you're not sure of precedence rules; they may be freely placed around numerical Expressions (or Boolean Expressions).

So,
2 - (4 - 3), has value 2 - 1=1, whereas 2 - 4 - 3, which is equivalent to (2 - 4) - 3, has value -2 - 3= -5.

f) Single-argument Functions

These take the form: Functor(Expression) and result in a number value.

Single-argument Functors are given below. In each case, the meaning of the function can be found by referring to the specified definition under Number Function - Row B

sqrt : Square Root
factorial : Factorial
abs : Absolute value
round : Round to nearest int.
ceiling : Nearest int. >= a
floor : Nearest int. <= a
sin : Sine (rads)
cos : Cosine (rads)
tan : Tangent (rads)
sindeg : Sine (degs)
cosdeg : Cosine (degs)
tandeg : Tangent (degs)
asin : Arcsine (rads)
arccos : Arccosine (rads)
arctan : Arctangent (rads)
arcsindeg : Arcsine (degs)
arccosdeg : Arccosine (degs)
arctandeg : Arctangent (degs)
log10 : Log base 10
loge : Log base e
ln : Log base e
alog10 : Antilog base 10
aloge : Antilog base e
aln : Antilog base e

Also, two lc-related single-argument functions are provided:

lc
This returns the item found at the specified position. E.g. lc(2), or lc(3-1), returns the item at position 2 of lc, so if lc=5,4,3 2, then the value of lc(2) would be 4.

lcposof
This returns the first position at which the specified item is found in lc, and returns 0 if it is not found. E.g. lcposof(4) returns the first position at which the value 4 is found in lc. So, if lc=5,4,3,2,4,1, then the value of lcposof(4) would be 2, while lcposof(7) would be 0.

f) Two-argument Functions

These take the form: Functor(Expression, Expression) , where a space after the comma is optional, and result in a number value.

All these functions are related to list lc. The two Expressions represent indices of lc and define some sublist of lc. For example, SomeFunctor(2, 5) specifies that some function should be applied to the list of items lc(2) through to lc(5). So, if lc=11, 12, 13, 14, 15, 16, 17, then SomeFunctor(2, 5) would represent the list 12, 13, 14, 15.

Note: to apply the function to the whole of list lc, use an expression of form: SomeFunctor(1, lclength) .

Two-argument Functors are given below. In each case, the meaning of the function can be found by referring to the specified definition under List Function to Number - Row C

lcsum : Sum of list values
lcproduct : Product of list values
lcave : Average (mean)
lcmax : Maximum value
lcmin : Minimum value
lcvariancen : Variance (N)
lcvariancen1 : Variance (N-1)
lcstdevn : Standard Dev'n (N)
lcstdevn1 : Standard Dev'n (N-1)
lc1q : First Quartile
lcmedian : Median
lc3q : Third Quartile
lcsumsquares : Sum of squares
lcrms : Root Mean Square

Examples:
If lc=11, 12, 13, 14, 15, 16, 17 then lcsum(2, 5) = sum of 12, 13, 14, 15 = 54
If lc=11, 12, 13, 14, 15, 16, 17 then lcsum(1, lclength) = sum of 11, 12, 13, 14, 15, 16, 17 = 98

h) Conditionals

Conditionals take the form: if(Boolean,Expression,Expression) and result in a number value.

The result is the value of the first Expression if the Boolean (see below) has the value True, otherwise, if the Boolean has the value False, the result is the value of the second Expression.

For example, if a has the value 3 and b the value 4, then the expression if(a>b, 1, -1) will result in the value of -1, as the Boolean a>b is False.

Note: Conditionals are Expressions just like any other, so may themselves be found in the arguments of a Conditional. This means they may be nested. So, if variable a represents a Soccer team's own score, while b represents the score of the opponent, then the points achieved by the team (3 for a win, 1 for a draw and 0 for a loss) would be defined by the Conditional:  if(a>b, 3, if(a=b, 1, 0)) which can be read as: if a>b then the value is 3 else (if a=b then the value is 1 else it is 0).

Note: The Boolean is evaluated first, and, based on this value, only one of the Expressions is evaluated. The other is not evaluated. This means that a Conditional such as if(a>0, sqrt(a), -1) will not yield an undefined result if a is negative, as sqrt(a) will not in that case be evaluated.

The Booleans (which result in values True or False) may be simple Comparisons of form:
Expression ComparisonOperator Expression (spaces between these are optional),
where the ComparisonOperators are the usual: >, >=, =, <>, <=, < (where <> means 'is not equal to').

Booleans may also be Boolean Functions of form: BooleanFunctor(Expression)
BooleanFunctors are: prime, integer, even, odd
These check whether the given numerical expression is a prime number, an integer, an odd number or an even number, respectively, and return True or False as appropriate.
Example: prime(5) returns the value True

A Boolean may also be a Negation of form: not(Boolean)
This returns True if the Boolean within the brackets has value False, and False if it has value True.
Example: not(prime(5)) returns the value False.

Finally, Booleans may be Boolean Operations of form: Boolean BooleanOperator Boolean ...
(spaces between these are optional).  Any number of BooleanOperator Boolean instances may follow the first.

BooleanOperators are:
or (alternative: ;)    This represents logical OR. It results in True if either (or both) of the Booleans has the value True), otherwise it results in False.
and (alternative: &) This represents logical AND. It results in True if both of the Booleans have the value True, otherwise it results in False.

Like numerical Operators, BooleanOperators have associated precedence values, or binding values: the higher the precedence, the closer the binding in expressions. The operations containing operators with the higher precedence or binding are evaluated first; those with operators of the same precedence are evaluated left-to-right. The operator precedence values are:

Precedence 1: or, ;
Precedence 2: and, &

So, a>b or a=b and b>c is equivalent to a>b or (a=b and b>c)

Parentheses may be used to override default BooleanOperator precedence or to clarify meaning.

Spaces

Spaces may freely be inserted before or after items in an expression, except that there must be no space between a Functor, a BooleanFunctor, not, if, or Unary minus (-) and its associated opening parenthesis. So,

a+b-3*(-4+sqrt(c)+if(a>b,5,6)) may be written as:  a + b - 3 * ( -4 + sqrt(c) + if( a > b, 5, 6 ) )

but sqrt (c) or if (a>b,5,6) would not be allowed.

Case insensitivity

All letters in an expression are case-insensitive. They may be upper- or lower-case.

So, a+b-3*(-4+sqrt(c)+if(a>b,5,6)) may be written as: A+b-3*(-4+SQRT(C)+If(a>B,5,6))

The expression AXE has the same meaning as a x e, or a*e.

Syntax errors

The syntax of an expression in a User-defined Operation is checked for syntax only after all the input fields have been checked and the calculations are about to be undertaken. If a syntax error is identified, the result of the calculation is shown as: Operation syntax error after:sometext where sometext represents the text that had been read before a syntax error was identified (either because an unexpected character was encountered or because the end of the expression was reached and the expression was incomplete).

So, if the expression a*b 4 were given, the result would be: Operation syntax error after:a*b

Memory Number - Row Y and Memory List - Row Z

The Memory Number and Memory List numipulation boxes are possibly the most difficult to understand. They are concerned with enabling you to carry out a series of calculations in which results from one press of the = button are used as inputs to the next.

If you don't use Memories, and keep the same values in all your numipulation boxes, you'd expect the results to be the same every time you press the = (Calculate) button (unless you've generated a list containing random numbers, carried out some random permutation of a list, or used now or cycle as inputs): same inputs, so same results. Memories essentially allow Numipulator to remember a result from one press of an = button and use that as an input to the next press of an = button, so that different results may be generated (it also works from one Repeat cycle to the next - see later). The behaviours of Memory Numbers and Memory Lists are identical.

During a calculation, two values associated with a Memory numipulation box may be evaluated:

  • The first, its current value, is specified by the mem field, second from bottom. This, like any other input field, may contain a number or a reference name (or a mixture of these in the case of a list). Once evaluated, the resulting value, which is the value that is used whenever the numipulation box is referred to in other boxes, is output into the result field at the bottom (next to the reference name, as with most other numipulation boxes). However, an unusual feature of the mem field is that you cannot type into it. Where the specification comes from is described below.
  • The second value that is derived during a calculation is based on the value or definition given in the next field, just above the mem field. You can type into this, and can specify a value, including the use of reference names, as you can with any other input field. The value is calculated just like any other value during the calculation; howevere, it is not, and cannot be, used as an input value to any numipulation box during this calculation. At the end of the calculation, the resulting value is output into the mem field. Now, because the value specified in the mem field becomes the value of the bottom or reference field, this means that this value will be the value of the reference field during the next calculation. The mem field is, therefore, the key to a Memory numipulation box: a result from one calculation cycle becomes an input/value in the next calculation cycle.
So, the value specified in the next field, becomes the value of the mem field at the end of calculation, which then becomes the value of the reference field during the next calculation. But where does the specification for the mem field come from initially, as you cannot type into it? If the mem field is found to be empty at the beginning of a calculation, the specification found in the init field (the top field of a Memory numipulation box - one you can type into) is moved into the mem field, ready for evaluation.

The best way to demonstrate this is to provide an example, which just makes use of one Number Operation and one Memory Number:

Number Operation
*1
*b
*A1
  
  i  
      
  X  
Memory Number
*init
*next
*mem
*Y1
  
  i  
      
  X  

This shows the state before the = button has been pressed, where the init field for Y1 is specified as 4, its next value is specified as A1, and the value of A1 is specified as Y1+1 (but none of these have been evaluated yet).

After pressing =, the boxes will look as follows:

Number Operation
*1
*b
*A1
  
  i  
      
  X  
Memory Number
*init
*next
*mem
*Y1
  
  i  
      
  X  

The specification in the init field, 4, would have been transferred into the mem field, as it was initially empty, and this has ended up as the result, or value, of Y1, as shown.

This value has been used to yield the value 5 for A1, as shown.

The next field is defined as A1, so the resulting value, 5, has been put into the mem field (overwriting the 4 that had been transferred there at the beginning). This will be the value of Y1 in any next cycle.

After pressing = again, the boxes will look as follows, since the value of Y1 is evaluated as 5 (from mem at the beginning of the calculation), and A1 is evaluated as Y1+1=5+1, i.e. 6, which also becomes the new value of mem. Note that the init field has not been used this time, as mem was not empty.

Number Operation
*1
*b
*A1
  
  i  
      
  X  
Memory Number
*init
*next
*mem
*Y1
  
  i  
      
  X  

Overall, then, you specify just two values for a Memory box:

  • the initial value, init, which is to be used if the mem field is empty;
  • the next value, next, whose result gets put into the mem field, and becomes the value of the Memory box during the next calculation.

From the description above, it sounds as though the value specified in the init field will only ever be used once: on the first-ever calculation, as the mem field will never be empty again. However, you can re-initialize all the Memory boxes by pressing the IM button (Initialize Memories) on the left. This clears the contents of the mem field and main result field, then, if the init field of a Memory is not empty, its contents are transferred into the mem field, to become the value of the Memory box at the next calculation. This means that you may re-run a set of calculations from scratch, or run them with a different data set. The boxes below shows the result of pressing the IM button after the last calculation in the example just shown: 4 has replaced 6 in the mem field, and the Y1 result field is empty.

Number Operation
*1
*b
*A1
  
  i  
      
  X  
Memory Number
*init
*next
*mem
*Y1
  
  i  
      
  X  

Important: If the next field is left empty, no change is made to the mem field during a calculation. By entering a specification only in the init field, a Memory Number or Memory List effectively acts as a Common Number or Common List, but one in which the actual value is visible in the result field.

You may find the L0 (empty list) constant useful when using Memory Lists. If building up a list of results at each cycle, you may need to define the initial value of the list as L0.

One time you might use Memories is when you're calculating compound interest with variable interest rates. You might want to calculate the interest earned in the first year, add it to the initial sum to give you the total at the end of the year, and then use this as the initial sum for the next year.  You can also use Memories for carrying out many complex list operations, since you can deal with one item from a list at a time, and construct the resulting list from the results of each cycle. Note: for many complex list operations, you will not need to use Memories, since Numipulator already has many item-by-item operations built in.

Note: When inspecting details of calculations or relationships using Values or Flow, you will see two distinct reference names associated with each Memory box. For example, you will find Y1 and newY1, where newY1 refers to the value derived from the specification in next, which will become the value of Y1 in the next calculation cycle. Remember that these new... names cannot be used as an input to any other field, and that during a calculation cycle Y1 and newY1 are independent: Y1 is defined by mem, while newY1 is defined by next.

Formula - Beneath Row Z

The Formula numipulation box is intended to provide solutions to specific, commonly-encountered formulae, such as volumes and areas of common shapes, and solutions to complex number operations.

The input list for Formula consists of parameters. The selected Formula operation may take 1 or more parameters, and the input list may contain more than one set of these parameters.

The number of input parameters for the selected Formula operation is implied by the items, separated by semicolons (;) following the colon (:) in the operation description. These also indicate what the numbers represent. For example, the operation Growth: Initial; Rate%; Periods indicates that this takes 3 parameters: the first represents the initial amount or size; the second represents the growth rate, expressed as a percentage (for a given period); and the third represents the number of periods being considered.

Calculation generates results for each set of parameters, and these form the result list. In the Growth example, there will be one number output for each set of three parameters in the input list (representing the final amount or size after this number of periods).

Growth: Initial; Rate%; Periods

This takes sets of three parameters representing the initial amount or size, the percentage rate of growth over a given period (e.g. year) and the number of periods (e.g. years). The calculation yields one number representing the final amount or size after the given number of periods at the given growth rate.

Example: p1,p2... p1,p2... ...=1000, 4, 5: Result=1216.653

This is useful for calculating compound interest at a fixed rate for a given time.

Length between points: X1; Y1; X2; Y2

There are four parameters in the set: X1; Y1; X2; Y2, where X1; Y1 are the coordinates of one point, and X2; Y2 are the coordinates of the second point. The result is the distance between the two points, based on the formula √((X2-X1)2+(Y2-Y1)2).

Example: If X1; Y1; X2; Y2 = 0, 0, 3, 4 then the result is 5

Areas

Circle area: Radius

There is only one parameter in the set: Radius (r) of the circle. The result is the area of the circle, based on the formula πr2.

Sphere surface area: Radius

There is only one parameter in the set: Radius (r) of the sphere. The result is the surface area of the sphere, based on the formula 4πr2.

Cone surface area: Radius; Height

There are two parameters in the set: Radius (r) of the base of the cone; height of the cone (h). The result is the surface area of the cone (inc. base), based on the formula πr(r+√( r2+h2)).

Triangle area: S1; S2; S3

There are three parameters in the set: the lengths of the three sides of the triangle (S1, S2 and S3). The result is the area of the triangle based on the formula √(S(S-S1)(S-S2)(S-S3) where S is the semi-perimeter of the triangle: (S1+S2+S3)/2.

Triangle area: Base; Height

There are two parameters in the set: the base length (b) of the triangle and its perpendicular height (h). The result is the area of the triangle, based on the formula bh/2.

Volumes

Sphere volume: Radius

There is only one parameter in the set: Radius (r) of the sphere. The result is the volume of the sphere, based on the formula 4/3(πr3).

Cone volume: Radius; Height

There are two parameters in the set: Radius (r) of the base of the cone; height of the cone (h). The result is the volume of the cone, based on the formula πr2h/3.

Pyramid volume: Base Area; Height

There are two parameters in the set: Base area of the pyramid (A); height of the pyramid (h). The result is the volume of the pyramid, based on the formula Ah/3.

Complex Number Operations

These are operations on complex numbers, i.e. on numbers having a real part and an imaginary part. The four operations defined, addition, subtraction, multiplication and division, each take as inputs four parameters, which define two complex numbers, C1 and C2:

R1 is the real part of C1
I1 is the imaginary part of C1
(so C1 = R1+I1i, where i is the square root of 1)
R2 is the real part of C2
I2 is the imaginary part of C2

In all four operations, the result is a list whose two elements represent R3 and I3, the real and imaginary parts of the resulting complex number, C3.

Complex addition: R1; I1; R2; I2

If C1 = 3 + 4i and C2 = 5 - 3i then enter parameters:

3, 4, 5, -3

The result is 8, 1 since C3 = C1 + C2 = 8 + i

Complex subtraction: R1; I1; R2; I2

If C1 = 3 + 4i and C2 = 5 - 3i then enter parameters:

3, 4, 5, -3

The result is -2, 7 since C3 = C1 - C2 = -2 + 7i

Complex multiplication: R1; I1; R2; I2

If C1 = 2 + 3i and C2 = 4 + 5i then enter parameters:

2, 3, 4, 5

The result is -7, 22 since C3 = C1 X C2 = -7 + 22i

Note: the formulae used are:
R3 = R1 X R2 - I1 X I2 
I3 = R1 X I2 + R2 X I1

Complex division: R1; I1; R2; I2

If C1 = -7 + 22i and C2 = 4 + 5i then enter parameters:

-7, 22, 4, 5

The result is 2, 3 since C3 = C1 / C2 = 2 + 3i

Note: the formulae used are:
R3 = (R1 X R2 + I1 X I2)/(R22 + I22)
I3 = (I1 X R2 - R1 X I2)/(R22 + I22)

Conversions

The conversions here are for those to or from measurements that are not simple decimal numbers, namely feet and inches (12 inches = 1 foot), pounds and ounces (16 oz = 1 lb) and stones and pounds (14 lb = 1 stone). In all cases, these non-decimal measurements are entered or output as two numbers: a whole number of the larger unit, e.g. feet, and a decimal number of the smaller unit. The metric unit equivalent is entered or output as a simple decimal number. All decimal number outputs are rounded to 2 decimal places.

Just two are given below, one non-metric to metric, and one metric to non-metric. The others follow the same pattern.

Conv ft & in -> cm: ft; in

There are two parameters in the set: the number of feet (should be a whole number); and the number of inches (decimal).
Example:p1,p2... p1,p2... ...=5, 11.5: Result=181.61, i.e. 5'11.5"=181.61cm

Conv cm -> ft & in: cm

There is one parameter in the set: the number of centimetres (should be a whole number). The output consists of two numbers for each input parameter: the number of feet (whole number) and the number of surplus inches (rounded to 2 decimal places).
Example:p1,p2... p1,p2... ...=189.5: Result=6, 2.61, i.e. 189.5cm=6'2.61"

Body Mass Index

Body Mass Index, or BMI, is a commonly-used measure to assess whether someone is overweight, obese, and so on. The BMI is determined by the formula W/H2, where W is body mass (weight) in kg and H is height in metres. So, a person whose weight is 75 kg and whose height is 1.75m has a BMI of 24.49. In all the cases below, the BMI is rounded to 2 decimal places. The four operations below determine BMI for different commonly-encountered ways of measuring height and weight.

BMI (height & weight): cm; kg

There are two parameters in the set: Height in cm; Weight in kg.
Example: p1,p2... p1,p2... ...=175, 75: Result=24.49

BMI (height & weight): ft; in; kg

There are three parameters in the set: The first two together express the height in feet and inches (the first is the number of feet; the second the number of inches); the third is the weight in kg.
Example: p1,p2... p1,p2... ...=5:9, 75: Result=24.21    (i.e. the BMI for a person of height 5'9" and weight 75kg is 24.21)

BMI (height & weight): ft; in; lb

There are three parameters in the set: The first two together express the height in feet and inches (the first is the number of feet; the second the number of inches); the third is the weight in pounds.
Example: p1,p2... p1,p2... ...=5:9, 166: Result=24.51    (i.e. the BMI for a person of height 5'9" and weight 166lb is 24.51)

BMI (height & weight): ft; in; stone; lb

There are four parameters in the set: The first two together express the height in feet and inches (the first is the number of feet; the second the number of inches); the last two express the weight in stones and pounds (the third is the number of stones; the fourth the number of pounds).
Example: p1,p2... p1,p2... ...=5:9, 11:12: Result=24.51    (i.e. the BMI for a person of height 5'9" and weight 11stone12 lb is 24.51)

Equation Solver - Beneath Row Z

The Equation Solver numipulation box is intended to provide solutions to equations: quadratic equations and simultaneous linear equations.

The input list for Equation Solver consists of a single set of coefficients for the equation(s).

Quadratic equation ax^2+bx+c: a; b; c

Given a quadratic equation of the form ax2+bx+c=0, the two solutions for x are given by the formulae:
x=(-b+√(b2-4ac))/2a or x=(-b-√(b2-4ac))/2a

For a set of three coefficients, representing the values of a, b and c, this operation generates a pair of numbers representing the two values of x.

Example: coeffs=2, 4, -16: Result=2, -4

Note: an error is generated if the number of coefficients is not three.

Simultaneous Eq'ns n: nX(n+1) coeffs

This operation is concerned with solving simultaneous linear equations, where there are unique solutions of the variables that satisfy the equations.

For example, given the two simultaneous linear equations:

5x - 2y = 4
 x + 2y = 8

the unique solutions for x and y that satisfy both equations are x = 2 and y = 3

The simultaneous equation operation in Numipulator is intended for solving n equations that contain n variables. The result is a list of the unique solutions for the n variables.

Each value in the input list coeffs represents a coefficient or constant in a set of linear equations of the form:

c11x1+c12x2+....c1nxn = k1
c21x1+c22x2+....c2nxn = k2
.....
cn1x1+cn2x2+....cnnxn = kn

where the coefficients c11, c12,.....cnn, kn are entered as a list (row-by-row starting from the top). 

Important: The constants of the n simultaneous equations (k1... kn) are always assumed to be on the right-hand side of the equations, following normal convention. This is different from quadratic equations where the constant (c) is, by convention, assumed to be on the left-hand side.

The number of simultaneous equations to be solved is not input explicitly. This is determined from the number of values in coeffs, since, if there are n equations, the number of coefficients is nX(n+1). So, for 2 equations there are 2X3=6 coefficients, for 3 equations there are 3X4=12 coefficients, for 4 equations there are 4X5=20 coefficients, and so on. If the number of values in coeffs does not correspond to an integer value for n, an error will be produced.

So, to solve two simultaneous equations such as:

5x - 2y = 4
 x + 2y = 8

the coefficients are input (in coeffs) as:

5, -2, 4
1, 2, 8

The result is a list containing the values of x and y that satisfy both these equations, namely:

2, 3

To solve the three equations:

x y + 2z = 1    
2x          -  z  = 2    
x + y + z  = 3    

enter 12 coefficients (note the 0 representing the coefficient of y in the second equation):

1, -1, 2, 1
2, 0, -1, 2
1, 1, 1, 3

The result is a list comprising the values of x, y and z that satisfy all three equations, namely:

1.25, 1.25, 0.5

Repeated calculations

Whenever you press the = (Calculate) button, one set of calculations is carried out and the results are displayed. The Go Until and Go For buttons for Repeat until and Repeat for allow you to perform a sequence of calculations before the results are displayed. They are intended principally for use with Memory Numbers and Memory Lists , since these enable you to carry results from one set of calculations as inputs to the next set of calculations. Only when the repetitions have completed are the results displayed.

Note: with both forms of repetition, the value of cycle is incremented each time (it has the value 1 for the first cycle).

Repeat for

The Repeat for functionality lets you specify a fixed number of calculations to be carried out. The number of repetitions to be carried out is defined in the Repeat for field - either as a directly input number, e.g. 10, or by a reference name. In both cases, when the Go... button to the right of the Repeat for field is pressed, one set of calculations is carried out (although if the Repeat for field is undefined, no calculation is carried out and an error message is given); the value of the Repeat for field is evaluated as part of this, and the number of further repetitions is based on the rounded value, N, of this field. If N is 2 or more, then N-1 further calculations are carried out. If N=1, then no further calculations are carried out.  If N<1, or if the Repeat for field has a value that is not a number, no further calculations are carried out, the results are displayed, and a suitable error message is given. Note: it is worth emphasizing that the number of repetitions is based solely on the value of the Repeat for field as determined by the first set of calculations; any change in this value has no effect on the number of repetitions.

If you are carrying out repeated complex calculations on each item of a list in turn, you would probably put the length of the list in the Repeat for field - either as a number, or, more generally, as the reference name of the List Function to Number numipulation box that returns the length of the list.

Repeat until

The Repeat until functionality allows you to specify that calculations should be repeated until some condition is met. 

The condition is specified as a comparison between two numbers, where the comparison is selected from a drop-down list as one of < , <= , = , <> , >= or > . Either of the two numbers may be specified directly as a number or by a reference name (just like any other input field). When the Go Until button to the right of the Repeat until field is pressed, one set of calculations is carried out (unless one or more of the input fields is undefined, in which case no calculation is carried out); the values of the two Repeat until fields are evaluated as part of this, and a check is made to see whether the condition is satisfied by these values.  If it is, no further calculations are carried out and the results are displayed; if it is not satisfied, a further set of calculations is carried out. This continues until the condition is satisfied.

If the value of either Repeat until input field is not a number, a suitable alert is given and no further repetitions are carried out.

Cycle

The number of cycles carried out when repetition stops is shown in the cycle field. This field also shows how many cycles have been carried out while repetition is carried out. Note: it also displays 1 after the '=' (Calculation) button is pressed. Pressing the Clear button resets this to 0. The output here corresponds to the value of cycle during the last cycle performed.

Stop Repetitions

In case you set up a repetition cycle that goes into a loop, e.g. because the Repeat until condition cannot be met, you may press the red Stop button on the left. This stops calculation at the end of a cycle, and the results so far are displayed.

Warning

Beware of setting a Repeat until condition that is based on the equality of two numbers that are not integers. The internal inaccuracies of Numipulator mean that even though you might expect equality, this may not be achieved. Even if the results output look as though the two numbers are the same, they may not be. See Accuracy and output number rounding for more on this.

Repetitions and Value Changes

Before a set of repetitions begins, and, indeed, before any calculation begins, Numipulator determines the inital values and relationships, as given by the text in the numipulation boxes, Mappings, etc. For the second and subsequent cycles, the values and relationships already defined are employed, so any changes to the numipulation box text (and this is possible under certain circumstances) will have no effect.

The only values that are independent of others (apart from functions generating random numbers or permutations) that can change from one cycle to another are:

  • now (the new time is checked at the beginning of each cycle)
  • cycle (increases by one each cycle)
  • Graphin1 and Graphin2, if graphical input between cycles is specifed
  • click (is set to 1 if a graphical input has been accepted, otherwise it is set to 0)
  • any Memory value, if a next value has been defined.

Repetitions and Memories

a) You might expect that if a certain number of calculation cycles were carried out using one of the Go... buttons, then the results would be exactly the same as if the = button were pressed the same number of times. However, there may be some differences. This may be for one or more of the following reasons:

  • Every time the = button is pressed, the value of cycle is set to 1, whereas for a repetition it is 1 for the first cycle, 2 for the second, and so on. For this reason, it is probably wise to avoid using the cycle value anywhere except in a Repeat until condition. It is better to set up your own incrementor, if you need one, using a Memory Number.
  • The value of now will be different, as will the value of any random number or permutation generated.

Mappings and Output Formatting

The Mappings box allows you to define words and symbols to represent numbers. The words and symbols may then be used in any list or number input field to represent that number. This allows you to enter data in terms that are more meaningful to you. For example, if you are entering data about certain countries, e.g. UK, USA, Germany and France, and are using the numbers 1, 2, 3 and 4 to represent these in your data, you can instead map these words to the numbers 1, 2, 3 and 4 in the Mappings box and enter lists or numbers that include these words. The word Germany will be treated as the number 3.

Mappings are entered in the Mappings box in the form of a list, where the groups of characters and numbers are separated by the same separators as numbers in a list input field. The list is treated as a sequence of Mapping Number pairs (any surplus word or number is ignored). So, to map UK, USA, Germany and France to 1, 2, 3 and 4, the list entered would be:

UK 1
USA 2
Germany 3
France 4

or even as

UK : 1, USA : 2;
Germany : 3          France, 4

Given these mappings, we could then have the two inputs to an addition being France and Germany. The answer would be 7.

Any sequence of characters may form the Mapping except the following:

  • any predefined constant or time, such as pi , e , now , or cycle
  • the word Mappings itself (this has special significance - see below)
  • those beginning with a numeral, a '+' followed by a numeral or a '-' followed by a numeral. The following are all invalid: 6A -6A +6A, as are 121.5 or 45 (you can't redefine numbers!)
  • any sequences that begin with one of the following: A , B , ... Z , List , Num , Form , Equation , Graphin , Control , newY , newZ followed by a sequence of numerals only. This ensures no conflict with Reference names or system names. So, the following are all invalid: C1, C67, List5. However, C, C1Credit, C1_Credit or C1-Credit, are valid as they do not end with a sequence of numerals only.

Note: symbols may also be included. One of the built-in Numiplets includes mappings to symbols: < <= = <> > >= to improve the interface.

A sequence of pairs may be preceded by the special word Mappings followed by a GroupName . Any mappings following, up till the next Mappings GroupName heading, form part of this mappings group. Although the mappings specified are used for inputs, the GroupNames are used for output formatting only (see below).

So, the Mappings box list might contain two mappings groups - one for countries, one for regions, as defined by the following list, which will be used in some examples below:

Mappings Countries
UK 1
USA 2
Germany 3
France 4
Mappings Regions
Europe 1
Africa 2
Americas 3
Asia 4
Australasia 5

Note: if the same name is mapped to 2 or more different numbers in the Mappings box, only the first such mapping is used for input mapping.

Output Formatting

The Table Formatter and Graphics Formatter both provide facilities for mapping outputs: taking a number and mapping it, or formatting it, to some sequence of characters. These can make outputs more meaningful.

In all cases, the formatting of a number is defined by a string of characters - an Output Formatting String .

In all cases, if no specific formatting is successfully applied, the default Output Number Rounding is applied.

a) Output Formatting String = Mappings

If the string consists of just the word Mappings , the first Mapping Number pair, where the Number = the number to be formatted, is found from the Mappings box. The Mapping is output instead of the number.

So, if the list of numbers to be formatted is: 1, 2, 3, 4, 5, 6
the output, given the Mappings definitions above, is: UK, USA, Germany, France, Australasia, 6

b) Output Formatting String = Mappings GroupName

If the string consists of the word Mappings followed by a GroupName (separated by a single space), the first Mapping Number pair, where the Number = the number to be formatted, is found from the specified Mapping Group.

So, if the Output Formatting String = Mappings Regions , then, if the list of numbers to be formatted is: 1, 2, 3, 4, 5, 6,
the output, given the Mappings above, is: Europe, Africa, Americas, Asia, Australasia, 6

In contrast, if the Output Formatting String = Mappings Countries , then, if the list of numbers to be formatted is: 1, 2, 3, 4, 5, 6,
the output, given the Mappings above, is: UK, USA, France, Germany, 5, 6

c) Output Formatting String contains internal mappings

If the string contains a colon, and is not one of the date formats described in e), the mapping is defined within the Output Formatting String itself. The string consists of one or more lines, each one of the form Test : Text

These lines are checked, in order, until a line is found where the number to be formatted satisfies the Test defined. If so, the output mapping is the Text on that line.

The Test components are simple comparisons: a comparison operator (<, <=, =, <>, >=, >) followed by a number. Alternatively, the Test may just be the single letter n , which always succeeds for any number. Note: the Text may include spaces; it may also be empty.

So, if the Output Formatting String is

=1:Very small
<5:Small
<10:Average
n:Large

the list of numbers 1, 4, 6.5, 12, -1 maps to:

Very small, Small, Average, Large, Very small

In contrast, if the Output Formatting String is

<10:Average
=1:Very small
<5:Small

the same list would map to:

Average, Average, Average, 12, Average

since any number < 10 immediately satisfies the first Test , so the later Tests are ignored. No Test succeeds for 12, so it is output with standard rounding.

Since these Output Formatting Strings may occur in more general Row Formatting Strings (see Table Formatter), certain characters or character sequences will be taken to represent other characters:

~ represents a tab (as you generally will not be able to type in a tab)
`t represents ~
`a represents @
`q represents `
`l represents | (where | is the 'vertical bar' character).

d) Output Formatting String is a non-negative integer

If the string is a simple positive integer, or 0, the number is rounded to this number of decimal places.

e) Output Formatting String is a date format

There are a number of date formats, intended for formatting a non-negative integer in the Numipulator YYYYMMDD data format, such as 20070331, which represents the date 31 March 2007.

The data formats are listed below, together with the output for the number 20070331:

DDMMYYYY - 31/03/2007
MMDDYYYY - 03/31/2007
YYYYMMDD - 2007/03/31
MMDD - 03/31
DDMM - 31/03
MMYYYY - 03/2007
YYYYMM - 2007/03

The date format may also be followed by a single character, which will be used as a separator instead of '/'. So, for example

DDMMYYYY: gives the output 31:03:2007

Date formats may also be used for times or other numbers. If the number is less than 10000, the YYYY part is taken as 0. Note: the DD and MM parts of the output always have two numerals (with initial zeros inserted if necessary), but the YYYY part has the minimum number of numerals possible. So, the input number 130512 would, for the format YYYYMMDD:, be output as 13:05:12.

Table Formatter

The Table Formatter lets you format a list of numbers into a table. This table is purely an output for display - it has no reference name so cannot be used as an input to any numipulation box. You can, of course, copy and paste the table into other applications, e.g. spreadsheets or word processors.

Essentially, it takes a list of numbers and displays it as a table, i.e. as a set of rows and columns. You may also specify lists of numbers to be displayed as column labels, row labels, or both. Additionally, there are four fields concerned with defining formatting strings.

In this formatted table, each row is displayed on a new line. The items on each row are, by default, separated by the selected output list separator, unless this is a paragraph, in which case a tab is used as the separator. So, since a new paragraph is the default list separator, the default separator of items in a table row is a tab. This makes the default table output suitable for copying and pasting into a spreadsheet.

There are four main inputs to the Table Formatter (all of which may be treated like inputs to numipulation boxes, i.e. you may use numbers, reference names, or, for lists, a mixture, to specify their values): la , n , Row labels and Column labels

The first input, la, defines the list of values to be shown in the table.

The second input, n, specifies either the number of rows or columns there should be in the output table (whether rows or columns is determined by the layout operation selected).

There are four format operations.  

Horizontally, n rows

This specifies that the values in la should be laid out horizontally (i.e. from left to right starting at the top left) in a table with n rows.

Example: For la=1, 2, 3, 4, 5, 6 and n=2, the table produced is:

1 2 3
4 5 6

Vertically, n columns

This specifies that the values in la should be laid out vertically (i.e. from top to bottom starting at the top left) in a table with n columns.

Example: For la=1, 2, 3, 4, 5, 6 and n=2, the table produced is:

1 3
2 4
3 6

Vertically, n rows

This specifies that the values in la should be laid out vertically (i.e. from top to bottom starting at the top left) in a table with n rows.

Example: For la=1, 2, 3, 4, 5, 6 and n=2, the table produced is:

1 3 5
2 4 6

Horizontally, n columns

This specifies that the values in la should be laid out horizontally (i.e. from left to right starting at the top left) in a table with n columns.

Example: For la=1, 2, 3, 4, 5, 6 and n=2, the table produced is:

1 2
3 4
5 6

The last two list inputs to the Table Formatter are:

  • Row labels . This is a list whose values form the labels of the output table rows (top-to-bottom). Specifying this is optional, but if it is specified, the number of values must equal the number of rows in the output table.
  • Column labels . This is a list whose values form the labels of the output table columns (left-to-right). Specifying this is optional, but if it is specified, the number of values must equal the number of columns in the output table.

Note: if both row labels and column labels are specified, the top-left 'cell' of the table displayed is represented by a single space character.

As an example of how you might use row and column labels, suppose you took two lists 3, 4, 5 and 10, 20, 30 40, and used the cross-pair operations to produce a list of containing the product of each cross-pair, i.e. 30, 60, 90, 120, 40, 80, 120, 160, 50, 100, 150, 200.  With this list as la and a value of 3 for n , then if the format operation Horizontally, n rows is selected with the row labels defined as 3, 4, 5 and the column labels as 10, 20, 30 40, the following overall table is displayed:

Note: If la is an empty list, L0 only is displayed in the table output field, as long as n is defined as a positive integer, regardless of whether row or column labels are defined, or of what their values/lengths are.

Note: There are also two output fields, Number rows and Number columns . These display the number of rows and columns in the main output table (excluding labels).

More advanced formatting

In addition to enabling you to display a table of numbers with default separators, the Table Formatter also provides you with functionality that gives you a high degree of control over layout and the ability to include text in the table. Note: this section is complex, so our advice is that you leave off reading this initially, and look at some built-in Numiplets to gain a better understanding.

There are four fields concerned with this:

Column label text

This takes, as input, an Output Formatting String , as discussed in Output Formatting.

Each number in the Column label is formatted according to this string. This allows you to output text as column headings, instead of numbers, to make the table more meaningful.

So, given a table with three columns, and a column label list = 1, 2, 3, the following definition of Column label text

=1:Base cost
=2:Tax
=3:Total cost

would give the following column headings:

Base cost    Tax    Total cost

Row label text

Like Column label text, this takes, as input, an Output Formatting String. Each row label number is formatted according to this string.

Main format

This field takes a Row Formatting String as input. It defines the formatting of every row in the main table (but not the row labels), and partial formatting of the column label row.

A Row Formatting String defines both the formatting of separators (including any text coming before or after the number) and, optionally, the formatting of the numbers themselves. The general format is:

  SeparatorFormat @ OutputFormattingString @ SeparatorFormat @ OutputFormattingString @........

That is, each number in the row is denoted by a pair of @ symbols, optionally with an Output Formatting String that defines the formatting of the number in that position/column.

The SeparatorFormat consists of text specifying separators and any pre- or post-text.  It may be empty (and the first one will frequently be empty).

Certain characters or character sequences will be taken to represent other characters in these strings:

~ represents a tab (required as you generally can't enter a tab directly into your browser's field)
`t represents ~
`a represents @
`q represents `
`l represents | (where | is the 'vertical bar' character).

For example, to format a three-column table with values as follows:

20060331 24.657 13.32
20060415 14.683 29.671

so that the first column is formatted in DDMMYYYY format, the second column is rounded to 2 decimal places, and has a tab and a '$' symbol before it, and '(US)' after it, and the last column is preceded by a tab and has 'kg' after it, the following Row Formatting String is required:

@DDMMYYYY@~$@2@c~@@kg

Note: in this case, the number in the third column has no formatting (apart from default rounding), as there is no string between the two @ symbols. The ~ symbol represents a tab.

The resulting output is:

31/03/2006 $24.66(US) 13.32kg
15/04/2006 $14.68(US) 29.671kg

Note: If the string has more @ pairs than the number of columns in the table, the first surplus @ pair and any following text are ignored. If there are more columns than @ pairs in the string, the next column and subsequent ones take default formatting (and separators).

Note: Unless the Row Formatting String is completely empty, it always defines at least one separator. The final separator defined is the text from the last @ pair (if any) up to the end of the string (or up to the next single @ if this exists). So, if the Row Formatting String ends with @, the last separator defined is empty: the next value (assuming no repetition, see below) will be placed next to the one before, with no separating space, tab or any other character.

A Row Formatting String may also contain a repetition symbol, '|' (the bar character). Any text between this and the end of the string (or the next | if there is one) is treated as a repetition string, as long as it contains at least two @ symbols. When determining the formatting of a row, and a column is reached for which there is no @ pair in the Row Formatting String , the repetition string is added to the end of it.

So, given a Row Formatting String as follows:

@DDMMYYYY@| $@@

then the row 20060331 3.45 5.62 6.78

is formatted as

31/03/2006 $3.45 $5.62 $6.78

while a Row Formatting String as follows:

|$@0@(US)~

formats a row with any number of elements. For example, the row 3.45 5.62 6.78 is formatted as:

$3(US) $6(US) $7(US)

Note: If row labels are specified, and a Row Formatting String is defined, the separator between the label and first column must be explicitly defined.

Note: The separators and pre- and post-text defined by the Row Formatting String of Main format are also applied to the column label row, although the formatting of the numbers themselves is not applied to the column label values. These may, however, be overridden by a Row Formatting String defined in Column label format (see next).

Column label format

Column label format is another Row Formatting String that is applied only to the column labels. The formatting defined in this, overrides any formatting of separators (inc. pre- and post-text) defined in the Main format , and any formatting of the values defined in Column label text .

Note: If you wish to apply the formatting defined in the Column label text to a particular column, instead of defining a different format, enter no text between the two @ symbols for that column. If you wish to apply the default output number rounding to a particular column, enter the word default between, the two @ symbols.

So, if Column label text contains just the number 2 , meaning that column labels are to be rounded to 2 decimal places, and Column label format contains:

@@~@n:Cost@~@default@~

this means that the first column label will be rounded to 2 decimal places, the second will be the word Cost , while the third will be rounded according to the default Output Number Rounding.

Open button

The Open button, at the top right of the Table Formatter, displays the values, without the formatting defined in the Table Formatter, in a table/grid in the Information Zone. The form of this is suitable for copying and pasting into a spreadsheet.

Graphics Formatter

The Graphics Formatter is a powerful tool that lets you:

  • display a table of results in a grid;
  • associate colour and borders with the values displayed;
  • specify that certain values should not be displayed;
  • map text to the output values, both in the grid and in a feedback field;
  • provide graphical input, by mouse-clicking on the grid cells, including between repetition cycles;
  • display graphical output between repetition cycles.

Overall, these features provide you with a means of:

  • visualizing your data;
  • watching the progress of a set of repetitions graphically;
  • developing your own graphical tools and apps (Numiplets), including ones that are dynamic and display graphical changes at each cycle and allow mouse-click inputs;
  • having fun - seeing how calculations and manipulations of numbers can be used to produce puzzles and games - even those based around words and letters.

Yes, numbers can be fun, and Numipulator with its Graphics Formatter proves it.

The Graphics Formatter Grid

The visible Graphics Formatter grid is a 10X10 grid. The values of any table may be displayed in the cells of this grid. The table to be displayed is specified in the Table parameters boxes to its left: the field la specifies the list of values that form the table, while ncols specifies the number of columns in the table. The values are always laid out horizontally (left-to-right) starting at the top row, row 1.

A table that extends beyond 10X10 can also be specified for display, but only a 10X10 portion of it will be displayed. Other parts of the table can be viewed by using the +1 or +5 buttons or -1 or -5 buttons to move the focus of the display. The =1 button moves the display back to the first cell of the row or column.

Note: The row and column numbers being displayed are shown in the beige stripes at the left and top respectively.

Note: If the value of ncols is inappropriate for the number of values in la, the table will be treated as having one column only.

Adding colour

By default, the values of the table are displayed in white text fields on a white background (the black background showing at the beginning changes when a table is specified for display). All the other cells are shown completely blank.

However, there is another field, below ncols, called Cell colours . A list of values, which must be identical in length to that of la, may be specified in this. These values specify the background colours and borders to be displayed for the corresponding value in la.

The values on this list should normally be integers in the range -20 to 60. Essentially, these are mapped to 20 colours and to 4 types of border, as follows:

1=white; thin border
2=black; thin border
3=red; thin border
...
and so on up till
20=beige; thin border

The numbers from 21 to 40 have the same colours, but a medium border, while the numbers 41 to 60 have the same colour but with a thick border.

The numbers -1 to -20 have the same colours, but have no border. In addition, 0 has a black background and no border.

The full set of colour/border mappings can be seen clicking the Codes button near the top of the main Numipulator page. This also describes the use of other colour codes, which give you millions of available colours.

So, given la=1,2,3,4,5,6 and ncols=3 and Cell colours=3,3,3,-2,-2,-2, a table with 2 rows and 3 columns would be displayed, with the cells of the top row having a red background and thin border, and the cells of the second row having a black background and no border.

Mapping text or NOTEXT to the values displayed

As with the Table Formatter, text can be mapped to numbers and displayed on the grid instead of the numbers. The mapping is specifed in the Cell text field, which takes a simple Output Formatting String . So, if la=-1 -2 31 2 27 4;
ncols=2; and
Cell text=
=-1:Cost
=-2:Number
Cell colours=-8 -8 -3 -3 -3 -3

then a table showing:

Cost Number
31 2
27 4

would be displayed, where the top row has a yellow background and the other rows have a red background (all no borders).

Sometimes, you will choose not to display any text; in fact, you may wish to have no text field displayed in the middle of the grid cell. If you map any number to the special text value NOTEXT, the text field will not be displayed. This allows you to produce graphical output that has absolutely no text displayed, just colours.

The built-in Numiplets provide you with many examples of text-mapping and the use of NOTEXT. However, to try it out, enter the parameters 100, 20 in numipulation box G1 and select the operation p1 random ints 1->p2 . Then specify G1 as the list value for both la and Cell colours, ncols=10 and Cell text= n:NOTEXT. The last means that every number should be mapped to NOTEXT. When you press an '=' button, you should see the 20 colours randomly placed on the grid.

Feedback Text

Above the grid is a text field intended for providing feedback, additional information, and so on. The values to be displayed in this are specified in the Feedback values field on the right, while the text mappings for these values are specified in the Feedback text box, again as a simple Output Formatting String .

So, if the Feedback values were specified as P1, and the feedback text as:
=-1:You have
=-2:turns remaining. Good luck!
then, if P1 had the value -1 4 -2, the feedback provided to you in the Feedback field would be:

You have 4 turns remaining. Good luck!

Note: If you are dealing with exclusively non-negative numbers as 'real' values, you may find it useful to employ negative numbers for mapping letters and words to, as in the above Feedback.

Note: Feedback works only if the Graphical Formatter is in use (i.e. la and ncols are correctly defined).

Graphics with repetitions

On the left of the page are three small buttons below the green = button: Start, Go (both green) and Stop (red). These are all concerned with repetitions. Start and Go both initiate a set of Repeat Until cycles. So, if you wish to make use of these buttons, you need to define the Repeat Until values. Even if you wish to have only one cycle, you will need to define them (possibly by setting the constraint to be 1 = 1 , as this will be satisfied after one cycle).

By default, the output will be displayed graphically only at the end of the set of repetitions, or after the Stop button has been pressed. However, you can also choose to have the graphics displayed at the end of any cycle. To do so, specify a value in the field Control2 on the right of 1 or any value other than 0. This will cause the graphics to be displayed at the end of the cycle.

Note: By making a reference to some other numipulation box in Control2, which may have the value 0 in some cycles and non-zero in others, you can control when to display the graphics.

Note: If Control2 is not defined, graphics are not displayed between cycles.

Graphical inputs and clicks

By default, mouse-clicking on the grid cells has no effect. However, if you check the box to Allow graphical input on the right, clicking on the grid cells then has some effect. You should see the red bar beneath the check box change to green, to indicate that the system will accept your mouse-click.

When you click on one of the grid cells (and the band beneath the check box is green):

  • The Feedback field gives you feedback on which cell (Row number and Column number) you clicked, albeit probably only temporarily;
  • The Graphin1 field on the right is changed to the Row number of the selected cell;
  • The Graphin2 field on the right is changed to the Column number of the selected cell;
  • The value of the system value click is set to 1;
  • Assuming a set of repetitions is not already underway, a new set is begun, using the values of Graphin1 and Graphin2 specified by the mouse-click.
  • No further graphical input is allowed (the green band turns red) - unless expressly specified as below.
Note: Graphin1 and Graphin2, which are Common Numbers whose values cannot be typed in, can be specified as input values to any other numipulation box.

By default, no further graphical inputs (through mouse-clicking on the cells) are allowed until the current set of cycles ends, at which point the red band turns green again. However, you may specify a value in the field Control1 on the right. If the value of this, as calculated in a cycle, is greater than 0, the system will, at the end of that cycle, turn the band green, and wait for a period of approximately Control1 seconds, and accept any mouse-click made during that time (as shown by the band's being green). The last such click made during that time will be acknowledged by Numipulator (click will be set to 1,the new values of Graphin1 and Graphin2 will be used in the next cycle, and Feedback will display the Row and Column numbers of the cell selected). So, if Control1 has the value 1.5, the system will wait approx. 1.5 seconds to allow graphical input.

Note: The values of Graphin1 and Graphin2 remain unchanged in a set of cycles unless changed by a mouse-click. The system value click is important, as this is automatically set to 0 at each new cycle unless a click has been acknowledged, when it is set to 1. Your set-ups can therefore make a distinction between old and new values of Graphin1 and Graphin2.

Note: If Control1 is not defined, graphical input is not accepted during repetitions.

Start and Go buttons

Both the Start and the Go button initiate a set of Repeat Until cycles. They are however different. The Start button first initializes all the Memory numbers and lists. It also inspects the init values above Graphin1 and Graphin2, and, if any of these are defined, it copies the text into the main Graphin1 and Graphin2 fields. This ensures that if you use the Start button to begin, you can set the values of Graphin1 and Graphin2 appropriately. If you make use of Graphin 1 or Graphin2 in any other Numipulation box, you must set these init values, otherwise Graphin1/Graphin2 will have no values, so an error occurs. In contrast, the Go button does not carry out these initializations. This is a useful button if you have pressed the Stop button to inspect the state of your calculation and then wish to carry on calculating without re-initializing.

Bitmap

In the top-right corner of the Graphics Formatter is a grey square. This is a 40 pixel X 40 pixel bitmap area. Its use is very simple. If the lists in la and Cell colours each have 1600 numbers (i.e. 40X40) and ncols is defined as 40, so that a 40 X 40 table is defined, and all the colour values are >= 1000000000 (1 billion), the table of colours is also displayed in the bitmap area. This range of colour values allows you to represent 2563 colours, using Numipulator's RGB colour codes.

One of the built in Numiplets, Moving truck animation, demonstrates its use, and also the way in which it can be used for rudimentary pixel-level animation.

Open button

The Open button (near the bitmap area) opens up the Information Zone and displays the complete table currently being displayed in the Graphics Formatter (not just the 10X10 view). As it is at much smaller scale, the text fields and values are not displayed - only the colours. However, if you tap or hover the mouse over any cell, the value of that cell is displayed, together with the row and column number of the cell.

Accuracy and Output Number Rounding

As with all calculators and spreadsheets, Numipulator has accuracy limitations. Numipulator depends on the accuracy of the underlying browser's Javascript interpreter for its internal accuracy.

These accuracy limitations can cause some surprises. For example, with one browser, the simple subtraction 3.6-1 yields a result of 2.6, as you would expect; however, the subtraction 4.6-1 yields a result of 3.5999999999999996. For those undertaking simple calculations, presenting this as a result would probably be unacceptable.

For this reason, Numipulator, by default, rounds all outputs to 12 decimal places. With this rounding, 4.6-1 yields a result of 3.6.

You may change the rounding of all numbers output by selecting the number of decimal places to which rounding should be carried out (0 - 12) from the drop-down list under Output Number Rounding in the Settings section towards the bottom of the Numipulator page. You may also select Internal, which means that Numipulator applies no additional rounding of the answers produced by Javascript.

Output rounding to a lower number of decimal places can come in useful.  For example, if you're calculating the total price, including tax, of goods based on their base price, you will generally want to see answers displayed to two decimal places only.

Important: when a reference name is used in some calculation, the value used is the underlying value, not the value you see displayed after the set of calculations. So, if you have A1=2.8/5 and A2=A1+0.58 and you round outputs to 1 decimal place, the results will be shown as 0.6 and 1.1. You might have thought that A2=0.6+0.58 would be 1.18, which, when rounded to 1 decimal place, would be 1.2. But, the underlying value of A1 is 0.56, so the true value of A2 is 1.14, which rounds down to 1.1. 

If you want to ensure that rounded values are used as inputs, you will need explicitly to round values before they are used. So, if A1=2.8/5; B1=A1 with the Round to 1 dec. pl. function applied; and A2=B1+0.48, then the underlying value of A2 will be 0.6+0.48=1.08. With outputs rounded to 1 decimal place, the value of A2 will be displayed as 1.1.

The accuracy limitations mean that you will also find problems or errors with very large numbers (e.g. integers > 1014). So, for example, the addition operation 12345678901234567 + 0 might yield the result 12345678901234568. The same is true for very small numbers, and any numbers with a large number of numerals.

Note: The values put into the mem fields of Memory boxes are not rounded, but are the internal values. This helps to ensure that a series of calculations carried out by pressing the = button gives the same final outputs as a set of repetitions (where internal values are always used).

Errors

Errors may occur when you're using Numipulator, and these will be handled in different ways. In all the cases below, these errors are identified and displayed to you once an = button is clicked, or when a Go... or Start button is clicked. In addition, if an attempt is made to load a Numipulator set-up that is empty or has a syntax error, an alert box to this effect is displayed.

Note: if an alert box is displayed when an error is identified, you must acknowledge the alert by pressing the OK button, or similar, depending on your browser.
Note: the errors below are checked for in order. If one type of error is identified, you will not be alerted about the later types, even if they exist.

Incomplete inputs and other syntax errors

If a numipulation box or other feature with inputs (e.g. Repeat for, Repeat until, or Graphics Formatter) has text in one of its input fields but not in some other one that is required for the calculation to occur, no calculation takes place and an alert box is presented, which notes that a Syntax error has occurred in a particular field which is <empty>.

If the text in a number input field is not a single number or a valid reference name, no calculation takes place and an alert box is presented, which notes that a Syntax error has occurred in a particular field; the text input is also displayed.

If the text in a list field is analysed and contains an item that is not a number or a valid reference name, no calculation takes place and an alert box is presented, which notes that a Syntax error has occurred in a particular field; the item text is also displayed.

Note: if more than one syntax error is found, all are displayed in the alert box.

Undefined inputs

If the reference name of a numipulation box is used as an input, but the inputs for the numipulation are blank (so the value cannot be determined), no calculation takes place and an alert box is presented, which notes that a value is being specified but is undefined. Note: if more than one error of this type is identified, all are displayed in the alert box.

Circularity

If the linkage between numipulation boxes is defined in such a way that there is circularity, e.g. A1 depends on A1; or A1 depends on B1 which in turn depends on A1; or A1 depends on B1, B1 depends on C1 and C1 depends on A1, and so on, no calculation takes place and an alert box is presented. This notes that circularity has been found, and also states which numipulation boxes cannot be evaluated because of this circularity.

Errors during calculation

Even when calculation is underway, certain errors may be found. These do not result in alert boxes. Instead, the error message is shown as the result of the calculation (i.e. in the result field). Some of these error messages are produced by the underlying Javascript; others are identified and generated by Numipulator.

NaN - indicates that the result is Not a Number. Typically, this results if an attempt is made to produce a numerical value that cannot be defined, e.g. square root of a negative number.

undefined - indicates that the result cannot be determined.  This is the result of an attempting to carry out some operation that is invalid, e.g. find the first item of an empty list; or find the First quartile of two numbers; or calculate the index of some item in a table from its row and column numbers, where these are not input as positive integers.

Wrong type - indicates that a value passed as an input to a calculation is not a number (or, if a list, does not consist only of numbers). For example, if the result of an attempt to evaluate the square root of a negative number is used as an input to another numipulation box, the result will be Wrong type.

Other output error messages will be relevant to specific operations, e.g.

Error: Invalid ratio of list lengths (when attempting to merge two lists)
Error: Position and lengths do not match (when attempting to merge two lists)
Error: Unequal lengths (when trying to sort one list by another)

Values Button

Once a calculation (single or repeated) has been completed, you may press the Values button in the main set of buttons on the left of the page. This presents, in the Information Zone, a summary of the calculations carried out. For each numipulation box involved in the calculation, the reference name (followed by any associated note, in parentheses), is presented. Underneath this, all the inputs are listed, together with their associated inputs (including any reference names used - not their calculated values). Next, the operation is summarized. Lastly, the resulting value of the numipulation box is displayed (but not for Common Numbers or Lists, or Memory Numbers or Lists, unless their definitions included reference names). The values are not rounded. Similar details are given for the Formatters and the inputs of the Repeat for or Repeat until boxes.

All these are listed out in the order of evaluation. So, if A1 depends on A2, then the details for A2 will be presented before those for A1. In this way, the general flow of a set of calculations can be reviewed.

When a repetition has been carried out, only the values for the last cycle are presented.

The input text and output values are those input or derived during the calculation, even if the text has since been edited. The notes, however, are those currently in the Note fields.

Flow Button

At any time, you may press the Flow button to inspect the flow of data, or the dependencies between the various numipulation boxes and other fields. In the Information Zone, a table/graphic shows a tree-like representation of the relationships between the various numipulation boxes, fields and formatters. Below is part of one such representation.

Tableformatall
Q1
Num2
.
 
  |
  |
  '‑‑‑‑‑‑‑‑‑‑‑‑>
    depends on
 
T1
List1
.
 
  |
  |
  |
  |
  '‑‑‑‑‑‑‑‑‑‑‑‑>
    depends on
 
Num1
.
 
  |
  |
  '‑‑‑‑‑‑‑‑‑‑‑‑>
    depends on
 
Q2
Num2
.
 
  |
  |

 
  '‑‑‑‑‑‑‑‑‑‑‑‑>
    depends on
 
List1
.
 
  |
  |

 
  '‑‑‑‑‑‑‑‑‑‑‑‑>
    depends on
 
T1
@

Each element has a name with a box underneath for its associated note, so that you have some idea of what it represents.

In this example, Tableformatall, which represents the Table Formatter and all its various fields, including its row and column labels, is shown on the left. This indicates that it is an output only, so no other element is dependent on it. To the right of this is Q1, which means that at least one of its fields refers to Q1. Note that there are vertical lines down from this which lead to another element on which it depends, but this is not shown here (it has been cut off).

In turn, Q1 is shown to be dependent on Num2. This has a small dot after it, to indicate that it has no dependencies.

Q1 also has vertical lines below it, with pointers to the right showing that Q1 also depends on T1 and Q2.

T1 depends on two List1 and Num1, both without further dependencies.

Q2 depends on three elements: Num2, List1 and T1. While the first two of these have no further dependencies, T1 does, but as its tree has already been shown, it is not repeated, and a note is given afterwards that it is expanded above.

Overall, this helps you to understand your set-up better. It can also reveal some outputs on the left that you once used but no longer require and which can be deleted from your set-up. In a complex set-up, this is very likely to happen, as you will probably work in a bottom-up way, defining your data inputs, then performing calculations and manipulations of these, and so on until you define your final outputs, e.g. the Formatters. The Flow tool gives you, in contrast, a top-down view of the calculations and manipulations.

Note: if circularity is identified during this analysis, this is noted.

Note: Grafixformatall represents its various input fields, including cell colours and feedback values (but not the Graphics Control fields).

Input/Output: Numiplets

As the Numipulator application is written entirely in Javascript and HTML, it cannot carry out file operations, such as Save, as a typical spreadsheet package would. However, Numipulator does make provision for you to save your Numipulator set-up and to load a previously-saved Numipulator set-up.

There are two approaches to saving and loading your numipulator set-ups:

  • A manual approach in which you save to a text file;
  • An approach in which your set-up is saved to your browser's local storage. This works only if your browser supports local storage. They generally do if you're accessing Numipulator over the web, but some do not if you've saved Numipulator locally on your laptop or other device.

Regardless of the approaches available to you, you should still use the manual approach using text files for long-term storage or for sharing with others, so this approach will be covered first.

At the heart of both approaches is the concept of the Numiplet.

Numiplets

A Numiplet is formatted text that defines all the relevant settings of a Numipulator set-up, namely:

  • all non-empty input field text, together with the associated selected operation;
  • all non-empty note fields
  • the Numiplet name and description for the set-up
  • the number of columns in each of the main table rows
  • various other relevant settings (e.g. Auto Start, Allow graphical input, rounding, output separator)

You can consider a Numiplet as an app that is run within the Numipulator environment.

The Input/Output section deals with inputs of Numiplets on the left side (headed Input) and outputs on the right side (headed Output), each of which has a large box or text area.

Saving a Numiplet to a text file

The standard way of saving a Numiplet is to do so manually, to a text file that you create and save in a text editing application, such as Notepad on a Windows PC or TextEdit on a Mac.

Saving a Numiplet as a simple text file is carried out as follows:

1) Give your Numiplet a name. This is done in the field right at the top of the Input/Output: Numiplets section (Current Numiplet Name).

2) Give your Numiplet a description. This is particularly useful if you're intending to share it with others, but is also a good reminder for you. The Description text area is found in the bottom-left corner of the Graphics Formatter section. It is located here because you will often want to read the description when using the Graphics Formatter.

3) Decide whether you wish any action to occur when the Numiplet is re-loaded.

You have three choices, which can be selected by use of the radio buttons under the Auto Start and Go heading in the Settings section:

  • No action. This is the default.
  • Auto Start. This means that when re-loaded the Start button will, in effect, be automatically pressed, so the Memories, Graphin1 and Graphin2 will be initiated, and a set of Repeat Until cycles begun. This can be useful for ensuring that the Graphics Formatter grid is automatically set up to display the graphical interface.
  • Auto Go. This means that when re-loaded the Go button will, in effect, be automatically pressed, and a set of Repeat Until cycles begun. This can also be useful for ensuring that the Graphics Formatter grid is automatically set up to display the graphical interface.

4) Check that you haven't got large amounts of data in your inputs, unless this data will always be needed. If you have, delete the data in the field and replace it with a comment {....} so that the system knows you wish to save details of this field.

5) Press the Create Numiplet button, with the down-arrowhead, just under the Output heading.

This deletes any text in the Output box below it and replaces it with formatted text containing the necessary Numiplet details. The name (title) always appears at the top, followed by the description, and then details of the table row widths. All the input specifications for the numipulation boxes then appear, together with the associated operation selections. Next come the other settings, including mappings and formatting definitions. And finally, the notes are listed. This Numiplet contains everything that you need to save.

6) Copy the all the text from the Output box and paste it into a new text document (CTRL-A, and then CTRL-C, and then CTRL-V to paste it into the text document on a Windows PC), which should then be saved.

Loading a Numiplet

To load a previously-saved Numipulator set-up, follow these steps:

1) Delete any text already in the Input box on the left (e.g. click in the field and press CTRL-A then hit the Delete button on a Windows PC). Open up the text file containing your Numiplet. Copy all the set-up text from its source document (e.g. CTRL-A then CTRL-C on a PC) and paste it into the Input box (e.g. CTRL-V on a PC).

2) Press the yellow Load Numiplet button above the box, with the up-arrowhead. This will load your Numiplet, including executing Auto Start or Go, if defined.

Important: This will overwrite any existing set-up. Just in case you had not intended to overwrite this without saving it, the existing set-up is output as a Numiplet in the Output box, as if you had pressed the Create Numiplet button. You can then choose to ignore it, save it as a text file, or reload it by pressing the Transfer Numiplet button, which transfers the text into the Input box, and then pressing the Load Numiplet button.

Built-in Numiplets

Your introduction to Numiplets should come from trying out and using the built-in Numiplets. These are Numiplets that are always available to you within Numipulator. These not only provide you with useful applications, or provide you with some fun, they also help to open your eyes to some of the possibilities open to you, and to the power of Numipulator.

The built-in Numiplets are accessible through a drop-down menu a little below the Input box. Select one of these, then press the yellow button, with the up-arrowhead, just above it, which transfers the built-in Numiplet into the Input box. This enables you to look at the Numiplet before loading it, particularly its description.

Once you are happy that you wish to load it, press the yellow Load Numiplet above the Input box. This will load it, and may begin to run the Numiplet, depending on the Auto Start setting.

Most of these Numiplets were created using a prototype version of Numipulator that did not allow more than 5 numipulation boxes in a row. This means that some inventive, convoluted ways of carrying out some operations needed to be employed, particularly in the Pentad Numiplet.

Numiplets with local storage

If your browser supports local storage, you will find an area underneath the drop-down menu of built-in Numiplets titled Your Numiplets in Local Storage. This allows you to save and load your Numiplets to and from local storage.

Local storage is an area of storage managed by your browser. Text can be saved to this, which can be retrieved by the browser at some later time. In some ways, use of local storage is like use of cookies, except there is no expiry time with local storage. The storage available to your browser should be a minimum of 1MB - substantially larger than cookie storage. The largest built-in Numiplet would take up less than 20kB, so even 1MB should leave plenty of room. It is worth noting, however, that other pages as well as Numipulator may use local storage, and the available space is shared. Large volumes of data stored in your Numiplets can greatly increase the amount of storage required, so do try to avoid this situation. Overall, local storage is very useful, but should not be relied on long-term, so you should save your Numiplets in text files as back-up.

Numipulator provides you with 20 local storage 'drawers' for storing your Numiplets in. Initially, these are all untitled with only a skeleton content.

Saving to a local storage drawer

Saving a Numiplet follows the same first 5 steps as described for saving to a text file, so that the text of the Numiplet is in the Ouput box. Next, you select one of the 20 numbered storage drawers from the drop-down menu (preferably an untitled one), and then press the yellow Save Numiplet to Selected Destination button above it, with the down-arrowhead. The only acknowledgement you get for this is that the drop-down menu reverts to its default message. Note: The Numiplet name is used as the name of the drawer. The former contents of the 'drawer' are saved to the Backed-up Numiplet.

Loading from a local storage drawer

To load a Numiplet from a local storage drawer, select it from the drop-down menu on the left, then press the yellow Transfer Saved Numiplet to Input box button above it, with the up-arrowhead, so that the stored text of the Numiplet is put into in the Input box. Finally, press the yellow Load Numiplet button to load it into Numipulator, as with loading from a text file.

Direct Save

Numipulator also has a single Current Saved Numiplet drawer. Press the yellow Save button, with the down-arrowhead, to save the current state of your Numipulator set-up as the Current Saved Numiplet, without first moving it into the Output box. This overwrites any existing content, which is saved as the Backed-up Numiplet. You can also press the main Save button on the left.

To restore the Current Saved Numiplet, press the Transfer Current Saved Numiplet to Input box button, with the up-arrowhead, to put the text into the Input box. From there you can load it, as previously described.

Auto Save on Exit

As described earlier, if your browser supports local storage and also allows actions when you exit Numipulator, your current Numipulator set-up is saved automatically as the Current Saved Numiplet when you exit (and the overwritten content is saved as the Backed-up Numiplet).

The Current Saved Numiplet, whether saved automatically or by use of a Save button, should be automatically restored whenever you open or reload Numipulator (with the same browser and device). You can also restore it manually via the Transfer Current Saved Numiplet to Input box button, or through the List button (see next).

List button

The central yellow List button lists, in the Information Zone, the contents of all 20 local storage drawers, followed by the Current Saved Numiplet and the Backed-up Numiplet. This is your only means of accessing the Backed-up Numiplet, if needed. Probably more importantly, it means you can save all these Numiplets in a text file in one go by copying and pasting them into a text file.

Exiting from Numipulator without Auto Save

If you don't have local storage, or your browser doesn't support autosaving on exit, your current set-up cannot be saved when you exit Numipulator, so try to remember to save it using the Save button on the left before exiting. This is always good practice. If you forget, there may be an alternative: Numipulator always attempts to write your current set-up to a box in a pop-up window, so that you can save it afterwards. Note: Many browsers do not allow the opening of a new pop-up window on exit (see www.numipulator.com for more details), so do try to remember to Save your set-up.

Settings

The Settings section has three sub-divisions, each covered elsewhere in the Help:

Display Links

Near the top of the Numipulator page are four Display links, all of which are displayed in the pop-up window.

Getting Started

This provides advice on getting started with Numipulator.

Operations

This gives a full listing of the functions and operations found in the various types of numipulation box.

Codes

This lists the codes used to specify colours and borders in the Graphics Formatter and also the number codes used to specify functions, operations and comparisons in a number of 'meta-level' operations.

Description

This displays the description found in the Graphics Formatter.

Versions of Numipulator

This version of Numipulator is for an individual's non-commercial use only or for non-commercial educational purposes. Companies, corporations and other organizations may purchase Corporate Licences from TopAccolades Ltd. These may include corporate headers and logos. Details may be obtained at http://www.numipulator.com.

Terms of Use

See the Terms of Use section at the bottom of the main Numipulator page.

About Numipulator

Numipulator was designed and developed by Dr David Wolstenholme.

Numipulator is a registered trademark of TopAccolades Limited.

Copyright TopAccolades Limited, 2021