sgorsten / linalg

linalg.h is a single header, public domain, short vector math library for C++
The Unlicense
849 stars 68 forks source link

support for qexp, qlog, qpow #6

Closed ddiakopoulos closed 7 years ago

ddiakopoulos commented 7 years ago

I only had a need for qexp, however decided to addqlogand qpow for the sake of completeness.

Also the debatable addition of fract

sgorsten commented 7 years ago

I'm merging as-is, as I presume you have an immediate need, but we should clarify:

fract(x) only returns the fractional component for positive numbers. For negative numbers, it technically returns one minus the fractional component. We should clarify which behavior you actually want, and if it is indeed x - floor(x), perhaps there is a better name than fract to indicate it.