diff options
author | Thomas White <taw@bitwiz.me.uk> | 2021-01-09 12:13:12 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.me.uk> | 2021-01-09 12:13:12 +0100 |
commit | 3d4cdbf5bd80883e38a43db85595f20befec773d (patch) | |
tree | 914fd666756ee6450b5aefa7dea78619e0575b8e /guile | |
parent | 48c25dce6499f5ffa617813c36f2ae098557f15e (diff) |
Better rounding in set-chan-16bit
Diffstat (limited to 'guile')
-rw-r--r-- | guile/starlet/base.scm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/guile/starlet/base.scm b/guile/starlet/base.scm index 60665eb..0681da8 100644 --- a/guile/starlet/base.scm +++ b/guile/starlet/base.scm @@ -220,11 +220,10 @@ (round-dmx (/ (* 256 val) 100))) (define (msb val) - (round-dmx (/ val 256))) + (round-dmx (euclidean-quotient val 256))) (define (lsb val) - (round-dmx (logand (inexact->exact (round val)) - #b11111111))) + (round-dmx (euclidean-remainder val 256))) (define (state-for-each func state) |