diff options
Diffstat (limited to 'ebus-racket/layer7.rkt')
-rw-r--r-- | ebus-racket/layer7.rkt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ebus-racket/layer7.rkt b/ebus-racket/layer7.rkt index eb37e91..b335ddc 100644 --- a/ebus-racket/layer7.rkt +++ b/ebus-racket/layer7.rkt @@ -110,11 +110,13 @@ (+ 256 (bitwise-not v))) (if (= (bitwise-and highByte 128) 128) (* -1 - (+ (* 16 (u-not highByte)) - (highNibble (u-not lowByte)) - (/ (lowNibble (u-not lowByte) 16)))) - (+ (* 16 (u-not highByte)) - (highNibble lowByte) + (/ + (+ (arithmetic-shift (u-not highByte) 4) + (u-not (highNibble lowByte)) + (+ (u-not (lowNibble lowByte)) 1)) + 16.0)) + (+ (* 16 highByte) + (arithmetic-shift lowByte -4) (/ (lowNibble lowByte) 16)))) ;; type byteEnum |