ui32_to_p16, ui32_to_p8, ui32_to_p32, i32_to_p8, i32_to_p16 and i32_to_p32 all handle 0x80000000 incorrectly
Example:
#include "../..//source/include/softposit.h"
#include <assert.h>
int main () {
posit8_t p8 = ui32_to_p8(0x80000000u);
printf("p8.v = %02x\n", p8.v);
}
Converts to a NaR:
notgay:Linux-x86_64-GCC user$ ./a.out
p8.v = 80
Fuzzer output:
function posit16_fromui: slow and [softposit] disagree
slow : 7fff
: 8000
arg0: 80000000
function posit8_fromui: slow and [softposit] disagree
slow : 7f
: 80
arg0: 80000000
function posit32_fromui: slow and [softposit] disagree
slow : 7fb00000
: 80000000
arg0: 80000000
function posit8_fromsi: slow and [softposit] disagree
slow : 81
: 00
arg0: 80000000
function posit16_fromsi: slow and [softposit] disagree
slow : 8001
: 0000
arg0: 80000000
function posit32_fromsi: slow and [softposit] disagree
slow : 80500000
: 00000000
arg0: 80000000
"slow" is my mpfr-backed implementation.