3 ms·
the twos complement thing is really elegant (-p == (posit -(int p))) in c notation
by dnautics 1y ago
the twos complement thing is really elegant (-p == (posit -(int p))) in c notation
- adgjlsfhk1 1y agorelatedly, having the same ordering as signed ints just makes everything so much easier. You can just use your integer radix sort to sort your floats without having to deal with sign and nans first!
- immibis 1y agoSo do floats if you don't care about NaN
- tomsmeding 1y agoThey do not; if you sort as unsigned ints then negative floats sort above positive ones, and if you sort as signed ints then the negative range is reversed. IEEE floats are sign-magnitude, not twos-complement.