mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-14 15:04:09 +00:00
add sprout::log10, log2, log1p
This commit is contained in:
parent
29a55bf31d
commit
6baf082234
6 changed files with 167 additions and 1 deletions
|
@ -53,7 +53,8 @@ namespace sprout {
|
|||
inline SPROUT_CONSTEXPR FloatType
|
||||
log(FloatType x) {
|
||||
typedef double type;
|
||||
return !(x > 0) ? -std::numeric_limits<FloatType>::infinity()
|
||||
return x == 0 ? std::numeric_limits<FloatType>::quiet_NaN()
|
||||
: !(x > 0) ? -std::numeric_limits<FloatType>::infinity()
|
||||
: static_cast<FloatType>(sprout::math::detail::log_impl(x))
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue