mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
fix coding-stype
This commit is contained in:
parent
2012838899
commit
df3023db30
196 changed files with 2510 additions and 3945 deletions
|
@ -27,7 +27,10 @@ namespace sprout {
|
|||
: FloatType(1)
|
||||
;
|
||||
}
|
||||
template<typename FloatType, typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler>
|
||||
template<
|
||||
typename FloatType,
|
||||
typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR FloatType
|
||||
float_pow10(int exponent) {
|
||||
return exponent < 0
|
||||
|
@ -53,7 +56,10 @@ namespace sprout {
|
|||
: 0
|
||||
;
|
||||
}
|
||||
template<typename FloatType, typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler>
|
||||
template<
|
||||
typename FloatType,
|
||||
typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR int
|
||||
float_exponent10(FloatType val) {
|
||||
return val < 0
|
||||
|
@ -69,7 +75,10 @@ namespace sprout {
|
|||
//
|
||||
// float_digits
|
||||
//
|
||||
template<typename FloatType, typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler>
|
||||
template<
|
||||
typename FloatType,
|
||||
typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR int
|
||||
float_digits_impl(FloatType val) {
|
||||
return val < 1 ? 0
|
||||
|
@ -88,7 +97,10 @@ namespace sprout {
|
|||
//
|
||||
// float_digit_at
|
||||
//
|
||||
template<typename FloatType, typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler>
|
||||
template<
|
||||
typename FloatType,
|
||||
typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR int
|
||||
float_digit_of_impl(FloatType val) {
|
||||
return static_cast<int>((val - sprout::floor(val)) * 10);
|
||||
|
@ -102,7 +114,10 @@ namespace sprout {
|
|||
//
|
||||
// float_round_at
|
||||
//
|
||||
template<typename FloatType, typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler>
|
||||
template<
|
||||
typename FloatType,
|
||||
typename sprout::enabler_if<std::is_floating_point<FloatType>::value>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR FloatType
|
||||
float_round_impl(FloatType val, FloatType p10) {
|
||||
return sprout::round(val * p10) / p10;
|
||||
|
|
|
@ -10,7 +10,10 @@ namespace sprout {
|
|||
//
|
||||
// int_pow
|
||||
//
|
||||
template<typename IntType, int Base = 10, typename sprout::enabler_if<std::is_integral<IntType>::value>::type = sprout::enabler>
|
||||
template<
|
||||
typename IntType, int Base = 10,
|
||||
typename sprout::enabler_if<std::is_integral<IntType>::value>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR IntType
|
||||
int_pow(int exponent) {
|
||||
return exponent ? Base * sprout::detail::int_pow<IntType, Base>(exponent - 1)
|
||||
|
@ -28,7 +31,10 @@ namespace sprout {
|
|||
: 0
|
||||
;
|
||||
}
|
||||
template<int Base = 10, typename IntType, typename sprout::enabler_if<std::is_integral<IntType>::value>::type = sprout::enabler>
|
||||
template<
|
||||
int Base = 10, typename IntType,
|
||||
typename sprout::enabler_if<std::is_integral<IntType>::value>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR int
|
||||
int_digits(IntType val) {
|
||||
return val ? 1 + sprout::detail::int_digits_impl<Base>(val / Base)
|
||||
|
@ -39,7 +45,10 @@ namespace sprout {
|
|||
//
|
||||
// int_digit_at
|
||||
//
|
||||
template<int Base = 10, typename IntType, typename sprout::enabler_if<std::is_integral<IntType>::value>::type = sprout::enabler>
|
||||
template<
|
||||
int Base = 10, typename IntType,
|
||||
typename sprout::enabler_if<std::is_integral<IntType>::value>::type = sprout::enabler
|
||||
>
|
||||
inline SPROUT_CONSTEXPR int
|
||||
int_digit_at(IntType val, int digits) {
|
||||
return val < 0 ? -((val / sprout::detail::int_pow<IntType, Base>(digits)) % Base)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue