Morwenn / static_math

Compile time mathematic functions for C++14
MIT License
186 stars 22 forks source link

Missing replacement for std::lround and std::llround #22

Closed cuzdav closed 6 years ago

cuzdav commented 6 years ago

While relatively trivial, it'd be really nice to have coverage for the long and long long versions of round from the cmath library:

Morwenn commented 6 years ago

While I tried to avoid having different names for the same functions, and tried to cram everything under a specific overload, it seems fair enough for these functions. I would have loved to pass the return type as a template parameter, but since std::round(int) and std::lround(int) don't have the same return type (floating point vs. integer), it' probably fair to follow the standard and to provide similar functions.

Thanks for catching this :)