-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
half.h #55
Comments
I'm no expert on that matter. I took the fp16 conversion functions from http://half.sourceforge.net, which is supposed to implement the IEEE standard. If you think it is incorrect, please point to the part that is incorrect specifically and the documentation of the standard. Perhaps you can check with http://half.sourceforge.net as well? |
Sorry. I've checked it, and fp16 isn't IEEE standard, so it behaves differently from usual float and double. It is optimized solely for [-1.0; 1.0] range, so expects values to be normalized. Although theoretically, a hacked version of it can represent values up to 131072, which can be useful when fp16 is used as index into a lookup table, like i.e. for pow(x,1/2.2), which I'm using it for. |
Yes it behaves differently, but it is an IEEE standard I guess (https://en.wikipedia.org/wiki/Half-precision_floating-point_format). Anyway, doesn't matter, this is what it is :-) |
Yeah. They actually standardized it. I remember it being just some NVidia internal thingie. There is also bfloat16 format, which indeed acts as a normal float. |
Hi! Your half-float conversion is broken, because it maps larger numbers (>65536.0) to infinity. So you can't really do any HDR with them.
The text was updated successfully, but these errors were encountered: