Tapestry
Source Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Math

Common mathematical operations.

Definitions:

String Types:

Commands:

String Types

Comparison

Used when comparing values. The options are:

  • "equal_to"
  • "other_than"
  • "greater_than"
  • "less_than"
  • "at_least"
  • "at_most"

Commands

Remove the sign from a value and return its positive value.

Slots:

Terms:

value: NumEval

The value to normalize.

Add two numbers and return the result.

Slots:

Terms:

Add: NumEval

The augend.

value: NumEval

The addend.

Decrease a stored value and, optionally, return the new value.

Slots:

Terms:

Decrease: Address

A reference to the value to decrease. This reads and writes to that value.

by: optional NumEval

if not specified, decrements by 1.

Divide one number by another and return the result.

Slots:

Terms:

Divide: NumEval

The numerator.

value: NumEval

The divisor.

Increase a stored value and, optionally, return the new value.

Slots:

Terms:

Increase: Address

A reference to the value to increase. This reads and writes to that value.

by: optional NumEval

If not specified, increments by 1.

Compare two numbers.

Slots:

Terms:

Is: NumEval

The first number.

matching: Comparison

The specific way to compare the two numbers.

num: NumEval

The second number.

within: optional Num

A positive value to indicate how close the two numbers can be.

Compare two text values in "lexical" ( alphabetical ) order.

Slots:

Terms:

Is: TextEval

The first text value.

matching: Comparison

The specific way to compare the two text values.

text: TextEval

The second text value.

Compare two values. If the two values are of different types, this will attempt -- in a limited way -- to coerce the second value to match the type of the first value before comparing them.

Any value can be coerced to bool ( following the truthiness rules for [IsValue] ), and bool and num values can be coerced into text. Otherwise, the types of the values must match exactly.

Numbers are compared using an internally determined default tolerance. To control the tolerance between numbers, use [CompareNum].

Slots:

Terms:

Is: Assignment

The first value. If needed, the second value will coerced to match the type of the first.

matching: Comparison

The specific way to compare the two values.

value: Assignment

The first value. If needed, this value will coerced to match the type of the first value.

Divide one number by another and return the remainder.

Slots:

Terms:

Mod: NumEval

The dividend.

value: NumEval

The divisor.

Multiply two numbers and return the result.

Slots:

Terms:

Multiply: NumEval

The multiplier.

value: NumEval

The multiplicand.

Subtract two numbers and return the result.

Slots:

Terms:

Subtract: NumEval

The minuend.

value: NumEval

The subtrahend.