attractivechaos / klib

A standalone and lightweight C library
http://attractivechaos.github.io/klib/
MIT License
4.18k stars 556 forks source link

Avoiding floating point math in khash #131

Open larseggert opened 5 years ago

larseggert commented 5 years ago

It would be extremely nice for potential use on embedded devices if floating point math (i.e., use of __ac_HASH_UPPER and addition of 0.5) could be avoided in khash.

If that is not possible, it would be quite a bit better already if __ac_HASH_UPPER became a float, at least as an option/define.

WDYT? Are you open to a PR for either of those two?

larseggert commented 5 years ago

See #132 for a PR of the second alternative (i.e., single-precision math).