From 43941faa137ffd739ae93e19238cfc1d382b7428 Mon Sep 17 00:00:00 2001 From: Alex Turner Date: Fri, 15 Dec 2023 16:38:15 -0500 Subject: [PATCH] Truncate not round scaled signal value (#108) This matches the behavior of the current implementation --- spec.bs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec.bs b/spec.bs index f8eb34c..4d4dbcc 100644 --- a/spec.bs +++ b/spec.bs @@ -1798,9 +1798,8 @@ integer |maxAllowed| and a leading bid info 1. If |value|["{{PASignalValue/scale}}"] [=map/exists=], set |returnValue| to the result of multiplying |value|["{{PASignalValue/scale}}"] with |returnValue|. -1. Set |returnValue| to the integer result of rounding |returnValue| to the - nearest integer. If two integers are equally close, the result should be the - integer closer to negative infinity. +1. Set |returnValue| to the result of converting |returnValue| to an integer by + truncating its fractional part. 1. If |value|["{{PASignalValue/offset}}"] [=map/exists=], set |returnValue| to the result of adding |returnValue| to |value|["{{PASignalValue/offset}}"]. 1. Clamp |returnValue| to the range [0, |maxAllowed|] and return the result.