fluxsort icon indicating copy to clipboard operation
fluxsort copied to clipboard

"Long double" is not an 128bit integer

Open Soveu opened this issue 3 years ago • 2 comments

iirc, long double is a weird 80-bit floating point number that x86 apparently supports Depending on the compiled platform (32bit x86 or x86_64) the 80 bits get rounded up to 12 or 16 bytes https://github.com/scandum/fluxsort/blob/main/src/fluxsort.h#L177

Soveu avatar Oct 12 '21 20:10 Soveu

The bit value refers to the size and not the type, since int and long long can be used for 32 and 64 bit pointers.

I'm aware it's ambiguous for long doubles, but I had to name it something.

You could typedef a 96 and 128 bit structure and handle it that way, though it would result in a compilation error if you uncomment the cmp macro.

scandum avatar Oct 12 '21 22:10 scandum

long double is also 64-bit on Windows x64 and most non-x86 architectures, causing a duplicate case error.

easyaspi314 avatar Nov 14 '21 04:11 easyaspi314

I know it took a bit, but at last I've added a precompiler check for 64-bit long doubles, and I've documented the ambiguity of long doubles in quadsort.h and fluxsort.h.

scandum avatar Feb 07 '23 23:02 scandum