Skip to content

Commit

Permalink
Truncate not round scaled signal value (#108)
Browse files Browse the repository at this point in the history
This matches the behavior of the current implementation
  • Loading branch information
alexmturner authored Dec 15, 2023
1 parent 66f4bc3 commit 43941fa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1798,9 +1798,8 @@ integer |maxAllowed| and a <a spec="turtledove">leading bid info</a>
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.
Expand Down

0 comments on commit 43941fa

Please sign in to comment.