Skip to content

Commit

Permalink
docs: Modify specification of trunc_u and trunc_s. (#924)
Browse files Browse the repository at this point in the history
Turns out the implementation in the constant-folding code is already in
line with this modified specification, so this is not a breaking change.

Closes #771 .
  • Loading branch information
cqc-alec authored Apr 12, 2024
1 parent c4a5631 commit a4db014
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions specification/hugr.md
Original file line number Diff line number Diff line change
Expand Up @@ -1798,8 +1798,8 @@ Conversions between integers and floats:

| Name | Inputs | Outputs | Meaning |
| -------------- | --------- | ------------------------ | --------------------- |
| `trunc_u<N>` | `float64` | `Sum(#(int<N>), #(ErrorType))` | float to unsigned int. Returns an error when the float is non-finite or cannot be exactly stored in N bits. |
| `trunc_s<N>` | `float64` | `Sum(#(int<N>), #(ErrorType))` | float to signed int. Returns an error when the float is non-finite or cannot be exactly stored in N bits. |
| `trunc_u<N>` | `float64` | `Sum(#(int<N>), #(ErrorType))` | float to unsigned int, rounding towards zero. Returns an error when the float is non-finite. |
| `trunc_s<N>` | `float64` | `Sum(#(int<N>), #(ErrorType))` | float to signed int, rounding towards zero. Returns an error when the float is non-finite. |
| `convert_u<N>` | `int<N>` | `float64` | unsigned int to float |
| `convert_s<N>` | `int<N>` | `float64` | signed int to float |

Expand Down

0 comments on commit a4db014

Please sign in to comment.