Hi,
I seem to have issues with how ==, && and || are evaluated. Particularly in the following:
Code:
uint8_t 16float_equals(tfl16_t a, tfl16_t b) {
if ((((a^b)==0)) || ((a&0x3ff==0) && (b&0x3ff==0))) {// (((a<<17)|(b<<17))==0)) { // (((a<<1)|(b<<1))==0)) {
return 1;
} else {
return 0;
}
}
The second part checks for 0 and their variations in a custom 16 float in bit representation ie:
0b1000000000000000 = 0
0b0000010000000000 = 0
etc..
but it doesnt work for the following:
32768 and 0 where it says they are not the same