Float to conversin small values
Hello, While I am working on IEEE Float to 32 bit POSIT conversion , I found a problematic case. The problematic value is 5.22068150475e-36(IEEE format value:0x04de1030)
I use softfloat and softposit for IEEE to POSIT 32 bit conversion.My code is shown below " pA = posit32() fA = float32_t()
float_in= 0x04de1030 fA.fromBits(float_in)
float_val=float(fA.repr()) pA=convertFloatToP32(float_val) hex_pA=pA.v written_string="float "+hex(fA.toInt())+" posit "+hex(hex_pA) " The result of hex_pA is 0x2.
I think it should be 0x1. Because float exponent is -118, so regime is -30 than exponent is 2. Should posit number be 0x1?