

# Mathematical functions
<a name="recipe-actions.functions.math"></a>

Following, find reference topics for mathematical functions that work with recipe actions.

**Topics**
+ [ABSOLUTE](recipe-actions.functions.ABSOLUTE.md)
+ [ADD](recipe-actions.functions.ADD.md)
+ [CEILING](recipe-actions.functions.CEILING.md)
+ [DEGREES](recipe-actions.functions.DEGREES.md)
+ [DIVIDE](recipe-actions.functions.DIVIDE.md)
+ [EXPONENT](recipe-actions.functions.EXPONENT.md)
+ [FLOOR](recipe-actions.functions.FLOOR.md)
+ [IS\$1EVEN](recipe-actions.functions.ISEVEN.md)
+ [IS\$1ODD](recipe-actions.functions.ISODD.md)
+ [LN](recipe-actions.functions.LN.md)
+ [LOG](recipe-actions.functions.LOG.md)
+ [MOD](recipe-actions.functions.MOD.md)
+ [MULTIPLY](recipe-actions.functions.MULTIPLY.md)
+ [NEGATE](recipe-actions.functions.NEGATE.md)
+ [PI](recipe-actions.functions.PI.md)
+ [POWER](recipe-actions.functions.POWER.md)
+ [RADIANS](recipe-actions.functions.RADIANS.md)
+ [RANDOM](recipe-actions.functions.RANDOM.md)
+ [RANDOM\$1BETWEEN](recipe-actions.functions.RANDOM_BETWEEN.md)
+ [ROUND](recipe-actions.functions.ROUND.md)
+ [SIGN](recipe-actions.functions.SIGN.md)
+ [SQUARE\$1ROOT](recipe-actions.functions.SQUARE_ROOT.md)
+ [SUBTRACT](recipe-actions.functions.SUBTRACT.md)

# ABSOLUTE
<a name="recipe-actions.functions.ABSOLUTE"></a>

Returns the absolute value of the input number in a new column. *Absolute value* is how far the number is from zero, regardless of whether it is positive or negative

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "ABSOLUTE",
        "Parameters": {
            "sourceColumn": "freezingTemps",
            "targetColumn": "absValueOfFreezingTemps"
        }
    }
}
```

# ADD
<a name="recipe-actions.functions.ADD"></a>

 Sums the input column values in a new column, using (`sourceColumn1` \$1 `sourceColumn2`) or (`sourceColumn1` \$1 `value1`).

**Parameters**
+ `sourceColumn1` – The name of an existing column.
+ `value1` – A numeric value.
+ `sourceColumn2` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "ADD",
        "Parameters": {
            "sourceColumn1": "weight_kg",
            "sourceColumn2": "height_cm",
            "targetColumn": "weight_plus_height"
        }
    }
}
```

# CEILING
<a name="recipe-actions.functions.CEILING"></a>

Returns the smallest integer number greater than or equal to the input decimal numbers in a new column.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `value1` – A numeric value.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "CEILING",
        "Parameters": {
            "sourceColumn": "weight_kg",
            "targetColumn": "weight_kg_CEILING"
        }
    }
}
```

# DEGREES
<a name="recipe-actions.functions.DEGREES"></a>

Converts radians for an angle to degrees and returns the result in a new column.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "DEGREES",
        "Parameters": {
            "sourceColumn": "height_cm",
            "targetColumn": "height_cm_DEGREES"
        }
    }
}
```

# DIVIDE
<a name="recipe-actions.functions.DIVIDE"></a>

Divides one input number by another and returns the result in a new column.

**Parameters**
+ `sourceColumn1` – The name of an existing column.
+ `value1` – A numeric value.
+ `sourceColumn2` – The name of an existing column.
+ `value2` – A numeric value.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "DIVIDE",
        "Parameters": {
            "sourceColumn1": "height_cm",
            "targetColumn": "divide_by_2",
            "value2": "2"
        }
    }
}
```

# EXPONENT
<a name="recipe-actions.functions.EXPONENT"></a>

Returns Euler’s number raised to the *n*th degree in a new column.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "EXPONENT",
        "Parameters": {
            "sourceColumn": "age",
            "targetColumn": "age_EXPONENT"
        }
    }
}
```

# FLOOR
<a name="recipe-actions.functions.FLOOR"></a>

Returns the largest integral number greater than or equal to the input number in a new column.

**Parameters**
+ `sourceColumn1` – The name of an existing column.
+ `value` – A numeric value.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "FLOOR",
        "Parameters": {
            "targetColumn": "FLOOR Column 1",
            "value": "42"
        }
    }
}
```

# IS\$1EVEN
<a name="recipe-actions.functions.ISEVEN"></a>

Returns a Boolean value in a new column that indicates whether the source column or value is even. If the source column or value is a decimal, the result is false.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.
+ `trueString` – A string that indicates whether the value is even.
+ `falseString` – A string that indicates whether the value is *not* even.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "IS_EVEN",
        "Parameters": {
            "falseString": "Value is odd",
            "sourceColumn": "height_cm",
            "targetColumn": "height_cm_IS_EVEN",
            "trueString": "Value is even"
        }
    }
}
```

# IS\$1ODD
<a name="recipe-actions.functions.ISODD"></a>

Returns a Boolean value in a new column that indicates whether the source column or value is odd. If the source column or value is a decimal, the result is false.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.
+ `trueString` – A string that indicates whether the value is odd.
+ `falseString` – A string that indicates whether the value is *not* odd.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "IS_ODD",
        "Parameters": {
            "falseString": "Value is even",
            "sourceColumn": "weight_kg",
            "targetColumn": "weight_kg_IS_ODD",
            "trueString": "Value is odd"
        }
    }
}
```

# LN
<a name="recipe-actions.functions.LN"></a>

Returns the natural logarithm (Euler’s number) of a value in a new column.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "LN",
        "Parameters": {
            "sourceColumn": "weight_kg",
            "targetColumn": "weight_kg_LN"
        }
    }
}
```

# LOG
<a name="recipe-actions.functions.LOG"></a>

Returns the logarithm of a value in a new column.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.
+ `base` – The base of the logarithm. The default is 10.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "LOG",
        "Parameters": {
            "base": "10",
            "sourceColumn": "age",
            "targetColumn": "age_LOG"
        }
    }
}
```

# MOD
<a name="recipe-actions.functions.MOD"></a>

Returns the percent that one number is of another number in a new column.

**Parameters**
+ `sourceColumn1` – The name of an existing column.
+ `sourceColumn2` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "MOD",
        "Parameters": {
            "sourceColumn1": "start_date",
            "sourceColumn2": "end_date",
            "targetColumn": "MOD Column 1"
        }
    }
}
```

# MULTIPLY
<a name="recipe-actions.functions.MULTIPLY"></a>

Multiplies two numbers and returns the result in a new column.

**Parameters**
+ `sourceColumn1` – The name of an existing column.
+ `value1` – A numeric value.
+ `sourceColumn2` – The name of an existing column.
+ `value2` – A numeric value.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "MULTIPLY",
        "Parameters": {
            "sourceColumn1": "hourly_rate",
            "sourceColumn2": "hours",
            "targetColumn": "total_pay"
        }
    }
}
```

# NEGATE
<a name="recipe-actions.functions.NEGATE"></a>

Negates a value and returns the result in a new column. 

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "NEGATE",
        "Parameters": {
            "sourceColumn": "age",
            "targetColumn": "age_NEGATE"
        }
    }
}
```

# PI
<a name="recipe-actions.functions.PI"></a>

Returns the value of pi (3.141592653589793) in a new column.

**Parameters**
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "PI",
        "Parameters": {
            "targetColumn": "PI Column 1"
        }
    }
}
```

# POWER
<a name="recipe-actions.functions.POWER"></a>

Returns the value of a number to the power of the exponent in a new column.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `value` – A number whose value is to be raised.
+ `targetColumn` – The name of the new column to be created.
+ `exponent` – The power to which the value will be raised.

**Note**  
You can specify either `sourceColumn` or `value`, but not both.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "POWER",
        "Parameters": {
            "exponent": "3",
            "sourceColumn": "age",
            "targetColumn": "age_cubed"
        }
    }
}
```

# RADIANS
<a name="recipe-actions.functions.RADIANS"></a>

Converts degrees to radians (divides by 180/pi) and returns the value in a new column.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "RADIANS",
        "Parameters": {
            "sourceColumn": "weight_kg",
            "targetColumn": "weight_kg_RADIANS"
        }
    }
}
```

# RANDOM
<a name="recipe-actions.functions.RANDOM"></a>

Returns a random number between 0 and 1 in a new column.

**Parameters**
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "RANDOM",
        "Parameters": {
            "targetColumn": "RANDOM Column 1"
        }
    }
}
```

# RANDOM\$1BETWEEN
<a name="recipe-actions.functions.RANDOM_BETWEEN"></a>

In a new column, returns a random number between a specified lower bound (inclusive) and a specified upper bound (inclusive).

**Parameters**
+ `lowerBound` – The lower bound of the random number range.
+ `upperBound` – The upper bound of the random number range.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "RANDOM_BETWEEN",
        "Parameters": {
            "lowerBound": "1",
            "targetColumn": "RANDOM_BETWEEN Column 1",
            "upperBound": "100"
        }
    }
}
```

# ROUND
<a name="recipe-actions.functions.ROUND"></a>

Rounds a numerical value to the nearest integer in a new column. It rounds up when the fraction is 0.5 or more. 

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "ROUND",
        "Parameters": {
            "sourceColumn": "rating",
            "targetColumn": "rating_ROUND"
        }
    }
}
```

# SIGN
<a name="recipe-actions.functions.SIGN"></a>

Returns a new column with -1 if the value is less than 0, 0 if the value is 0, and \$11 if the value is greater than 0.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "SIGN",
        "Parameters": {
            "sourceColumn": "age",
            "targetColumn": "age_SIGN"
        }
    }
}
```

# SQUARE\$1ROOT
<a name="recipe-actions.functions.SQUARE_ROOT"></a>

Returns the square root of a value in a new column.

**Parameters**
+ `sourceColumn` – The name of an existing column.
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "SQUARE_ROOT",
        "Parameters": {
            "sourceColumn": "age",
            "targetColumn": "age_SQUARE_ROOT"
        }
    }
}
```

# SUBTRACT
<a name="recipe-actions.functions.SUBTRACT"></a>

Subtracts one number from another and returns the result in a new column. 

**Parameters**
+ `sourceColumn1` – The name of an existing column.
+ `value1` – A numeric value.
+ `sourceColumn2` – The name of an existing column.
+ `value2` – A numeric value. 
+ `targetColumn` – The name of the new column to be created.

**Example**  
  

```
{
    "RecipeAction": {
        "Operation": "SUBTRACT",
        "Parameters": {
            "sourceColumn1": "weight_kg",
            "targetColumn": "weight_minus_10_kg",
            "value2": "10"
        }
    }
}
```