artyom-beilis / float16

half float library for C and for z80
MIT License
34 stars 7 forks source link

Expose IS_INF and IS_NAN in API #4

Open nemequ opened 4 years ago

nemequ commented 4 years ago

These are useful, please expose them.

Since it would be better not to leak implementation details, I'd suggest that instead of macros you use f16_isnan and f16_isinf functions to match the standard C functions. It might also be nice to have f16_fpclassify and f16_isnormal too.

artyom-beilis commented 4 years ago

In this case I think macros is better this stuff like f16_isinf(x) (((x) & 0x7FFF)==0x7C00) and since there is no C++ style inline functions in C it would rather be better to use macro.