diff --git a/thiersort.h b/thiersort.h index f2d3cac..f031aae 100644 --- a/thiersort.h +++ b/thiersort.h @@ -411,14 +411,16 @@ static inline TSU8 ts_radixi( k.f = (float)(arr[i].u); /* 8 bit float */ - k.u >> 24; + /* top bit always zero so ignore it and use 8 useful bits */ + /* - this is why we shift 23 and not 24 here */ + k.u >> 23; /* We are fine! */ return (TSU8)k.u; } if(isfloat) { /* Sign bit can be 1! */ - k.f = (float) (arr[i].f); + k.f = arr[i].f; /* 8 bit float */ k.u >> 24;