Skip to content

Commit

Permalink
Merge pull request #310 from Chia-Network/fix-table
Browse files Browse the repository at this point in the history
fix operator table
  • Loading branch information
arvidn authored Aug 5, 2024
2 parents 29d6aba + 964f365 commit 19471f7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions docs/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,23 @@ Additionally, they do not have an intrinsic cost, since they are compiled to CLV

## Arithmetic

| Operator | Format | Description |
| -------- | -------------- | ----------------------------------------------- |
| + | `(+ A B ...)` | Adds multiple atoms. |
| - | `(- A B ...)` | Subtracts multiple atoms. |
| \* | `(* A B ...)` | Multiplies multiple atoms. |
| / | `(/ A B)` | Divides two atoms. Rounds towards negative |
| | | infinity. |
| divmod | `(divmod A B)` | Calculates quotient and remainder in cons pair. |
| Operator | Format | Description |
| -------- | -------------- | ----------------------------------------------------- |
| + | `(+ A B ...)` | Adds multiple atoms. |
| - | `(- A B ...)` | Subtracts multiple atoms. |
| \* | `(* A B ...)` | Multiplies multiple atoms. |
| / | `(/ A B)` | Divides two atoms. Rounds towards negative infinity. |
| divmod | `(divmod A B)` | Calculates quotient and remainder in cons pair. |

### Negative Division

:::info

In earlier versions of Chia, the `/` operator produced incorrect rounding when used with negative numbers. It was disabled in a [soft-fork at block height 2,300,000](https://www.chia.net/2022/03/04/divided-we-fork.en.html). It was enabled again in the hard fork, with correct behavior. It always rounds towards negative infinity
In earlier versions of Chia, the `/` operator produced incorrect rounding when
used with negative numbers. It was disabled in a [soft-fork at block height
2,300,000](https://www.chia.net/2022/03/04/divided-we-fork.en.html). It was
enabled again in the hard fork, with correct behavior. It always rounds towards
negative infinity.

:::

Expand Down

0 comments on commit 19471f7

Please sign in to comment.