(define (bytes->number bytes signed?) (let* ((hi (u8vector-ref bytes 0)) (lo (u8vector-ref bytes 1)) (u (fxior (fxshl hi 8) lo)) (s (if (bit-set? u 15) -1 1))) (if signed? (fx* s (fxand (fxnot (fxshl 1 15)) u)) u)))