conspack/cl-conspack

sign bit lost on integers between -128 and -1 inclusive

Closed this issue · 4 comments

(defun copy (x) (conspack:tracking-refs () (conspack:decode (conspack:encode x)))) => COPY
(copy -1) => 255, 2
(copy #(-129 -128 -127 "..." -3 -2 -1 0 1 2)) => #(-129 128 129 "..." 253 254 255 0 1 2), 26
(let ((range (ash 1 17)) (acc ())) (dotimes (foo 1000000) (let ((x (- (/ range 2) (random range)))) (when (not (equalp x (copy x))) (push x acc)))) (remove-duplicates (sort acc #'>))) => (-1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106 -107 -108 -109 -110 -111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128)

rpav commented

Wow. I wonder if this is related to the last fast-io change.

rpav commented

Yeah, rpav/fast-io@3fff9ed seems to be the beginning of breakage

rpav commented

Fix to fast-io should fix this issue.

thank you! and that was a very prompt reply too! 💯 much appreciated