From a4db01496b946a22d8ce3f3ead5c7f81ddc99a5a Mon Sep 17 00:00:00 2001 From: Alec Edgington <54802828+cqc-alec@users.noreply.github.com> Date: Fri, 12 Apr 2024 15:54:44 +0100 Subject: [PATCH] docs: Modify specification of `trunc_u` and `trunc_s`. (#924) 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 . --- specification/hugr.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/hugr.md b/specification/hugr.md index 07eab9b09..f2baa4602 100644 --- a/specification/hugr.md +++ b/specification/hugr.md @@ -1798,8 +1798,8 @@ Conversions between integers and floats: | Name | Inputs | Outputs | Meaning | | -------------- | --------- | ------------------------ | --------------------- | -| `trunc_u` | `float64` | `Sum(#(int), #(ErrorType))` | float to unsigned int. Returns an error when the float is non-finite or cannot be exactly stored in N bits. | -| `trunc_s` | `float64` | `Sum(#(int), #(ErrorType))` | float to signed int. Returns an error when the float is non-finite or cannot be exactly stored in N bits. | +| `trunc_u` | `float64` | `Sum(#(int), #(ErrorType))` | float to unsigned int, rounding towards zero. Returns an error when the float is non-finite. | +| `trunc_s` | `float64` | `Sum(#(int), #(ErrorType))` | float to signed int, rounding towards zero. Returns an error when the float is non-finite. | | `convert_u` | `int` | `float64` | unsigned int to float | | `convert_s` | `int` | `float64` | signed int to float |