Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Float Math functions #1461

Merged
merged 3 commits into from
Jun 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 77 additions & 8 deletions content/en/docs/chart_template_guide/function_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ They are listed here and broken down by the following categories:
* [Logic and Flow Control](#logic-and-flow-control-functions)
* [Lists](#lists-and-list-functions)
* [Math](#math-functions)
* [Float Math](#float-math-functions)
* [Network](#network-functions)
* [Reflection](#reflection-functions)
* [Regular Expressions](#regular-expressions)
Expand Down Expand Up @@ -1784,6 +1785,82 @@ Return the smallest of a series of integers.

`min 1 2 3` will return `1`.

### len

Returns the length of the argument as an integer.

```
len .Arg
```

## Float Math Functions

All math functions operate on `float64` values.

### addf

Sum numbers with `addf`

This will return `5.5`:

```
addf 1.5 2 2
```

### add1f

To increment by 1, use `add1f`

### subf

To subtract, use `subf`

This is equivalent to `7.5 - 2 - 3` and will return `2.5`:

```
subf 7.5 2 3
```

### divf

Perform integer division with `divf`

This is equivalent to `10 / 2 / 4` and will return `1.25`:

```
divf 10 2 4
```

### mulf

Multiply with `mulf`

This will return `6`:

```
mulf 1.5 2 2
```

### maxf

Return the largest of a series of floats:

This will return `3`:

```
maxf 1 2.5 3
```

### minf

Return the smallest of a series of floats.

This will return `1.5`:

```
minf 1.5 2 3
```

### floor

Returns the greatest float value less than or equal to input value.
Expand All @@ -1803,14 +1880,6 @@ after the decimal point.

`round 123.555555 3` will return `123.556`.

### len

Returns the length of the argument as an integer.

```
len .Arg
```

## Network Functions

Helm has a single network function, `getHostByName`.
Expand Down