Skip to content

Commit e9438e6

Browse files
committed
fixed copy&paste error and minor mess
1 parent 7abb574 commit e9438e6

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -406,16 +406,16 @@ supported floating-point types: `float`, `double`, etc.
406406
For example, to get result as `float` use
407407
`fast_float::integer_times_pow10<float>()` specialization:
408408
```C++
409-
const uint64_t W = 1234567;
409+
const uint64_t W = 12345678;
410410
const int Q = 23;
411-
const double result = fast_float::integer_times_pow10<float>(W, Q);
412-
std::cout.precision(7);
411+
const float result = fast_float::integer_times_pow10<float>(W, Q);
412+
std::cout.precision(9);
413413
std::cout << "float: " << W << " * 10^" << Q << " = " << result << " ("
414-
<< (result == 1234567e23f ? "==" : "!=") << "expected)\n";
414+
<< (result == 12345678e23f ? "==" : "!=") << "expected)\n";
415415
```
416416
outputs
417417
```
418-
float: 1234567 * 10^23 = 1.234567e+29 (==expected)
418+
float: 12345678 * 10^23 = 1.23456782e+30 (==expected)
419419
```
420420

421421
Overloads of `fast_float::integer_times_pow10()` are provided for

tests/example_integer_times_pow10.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ void double_specialization() {
2121
}
2222

2323
void float_specialization() {
24-
const uint64_t W = 1234567;
24+
const uint64_t W = 12345678;
2525
const int Q = 23;
26-
const double result = fast_float::integer_times_pow10<float>(W, Q);
27-
std::cout.precision(7);
26+
const float result = fast_float::integer_times_pow10<float>(W, Q);
27+
std::cout.precision(9);
2828
std::cout << "float: " << W << " * 10^" << Q << " = " << result << " ("
29-
<< (result == 1234567e23f ? "==" : "!=") << "expected)\n";
29+
<< (result == 12345678e23f ? "==" : "!=") << "expected)\n";
3030
}
3131

3232
int main() {

0 commit comments

Comments
 (0)