fixed copy&paste error and minor mess

This commit is contained in:
Pavel Novikov 2025-09-29 19:54:22 +03:00
parent 7abb574ffc
commit e9438e64ba
No known key found for this signature in database
GPG Key ID: F2C305CAE4167D14
2 changed files with 9 additions and 9 deletions

View File

@ -406,16 +406,16 @@ supported floating-point types: `float`, `double`, etc.
For example, to get result as `float` use For example, to get result as `float` use
`fast_float::integer_times_pow10<float>()` specialization: `fast_float::integer_times_pow10<float>()` specialization:
```C++ ```C++
const uint64_t W = 1234567; const uint64_t W = 12345678;
const int Q = 23; const int Q = 23;
const double result = fast_float::integer_times_pow10<float>(W, Q); const float result = fast_float::integer_times_pow10<float>(W, Q);
std::cout.precision(7); std::cout.precision(9);
std::cout << "float: " << W << " * 10^" << Q << " = " << result << " (" std::cout << "float: " << W << " * 10^" << Q << " = " << result << " ("
<< (result == 1234567e23f ? "==" : "!=") << "expected)\n"; << (result == 12345678e23f ? "==" : "!=") << "expected)\n";
``` ```
outputs outputs
``` ```
float: 1234567 * 10^23 = 1.234567e+29 (==expected) float: 12345678 * 10^23 = 1.23456782e+30 (==expected)
``` ```
Overloads of `fast_float::integer_times_pow10()` are provided for Overloads of `fast_float::integer_times_pow10()` are provided for

View File

@ -21,12 +21,12 @@ void double_specialization() {
} }
void float_specialization() { void float_specialization() {
const uint64_t W = 1234567; const uint64_t W = 12345678;
const int Q = 23; const int Q = 23;
const double result = fast_float::integer_times_pow10<float>(W, Q); const float result = fast_float::integer_times_pow10<float>(W, Q);
std::cout.precision(7); std::cout.precision(9);
std::cout << "float: " << W << " * 10^" << Q << " = " << result << " (" std::cout << "float: " << W << " * 10^" << Q << " = " << result << " ("
<< (result == 1234567e23f ? "==" : "!=") << "expected)\n"; << (result == 12345678e23f ? "==" : "!=") << "expected)\n";
} }
int main() { int main() {