LiraNuna / soft-ieee754

Software implementation of any size ieee754 floating points

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected behavior

sherief opened this issue · comments

I wrote a small test program (at https://gist.github.com/sherief/5233408 ) and the output I'm getting doesn't match how fp16 (half) types work.

Hello,

What would you think is the expected behaviour? Your test program will stop counting at 2048 because of the loss of precision in the mantissa.

You can observe the same behaviour with hardware 32bit floats except the result will take much more time (it will occur after the counter reaches 1 << 25, which is 33554432).

You're absolutely correct, my source of confusion was due to an error in my own code.