| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | //====================================================================================================================== | ||
| 2 | /* | ||
| 3 | POLYFLOAT - Extended precision floating points | ||
| 4 | Copyright : POLYFLOAT Contributors & Maintainers | ||
| 5 | SPDX-License-Identifier: BSL-1.0 | ||
| 6 | */ | ||
| 7 | //====================================================================================================================== | ||
| 8 | #pragma once | ||
| 9 | #include <eve/module/core.hpp> | ||
| 10 | #include <string> | ||
| 11 | |||
| 12 | namespace plf | ||
| 13 | { | ||
| 14 | //==================================================================================================================== | ||
| 15 | //! @name Streaming Operators | ||
| 16 | //! @related polyfloat | ||
| 17 | //! @{ | ||
| 18 | //==================================================================================================================== | ||
| 19 | |||
| 20 | /// Stream insertion for Poly-Float based types | ||
| 21 | 6825 | template<typename C, typename Ct, concepts::polyfloat CD> auto& operator<<(std::basic_ostream<C, Ct>& os, CD const& z) | |
| 22 | { | ||
| 23 | 8283 | auto display_positive = [](auto& os, auto e, bool first) -> decltype(auto) { | |
| 24 |
8/8✓ Branch 0 taken 1026 times.
✓ Branch 1 taken 1978 times.
✓ Branch 3 taken 1328 times.
✓ Branch 4 taken 1365 times.
✓ Branch 6 taken 431 times.
✓ Branch 7 taken 784 times.
✓ Branch 9 taken 672 times.
✓ Branch 10 taken 699 times.
|
8283 | if (first) return os << e; |
| 25 |
8/8✓ Branch 2 taken 1297 times.
✓ Branch 3 taken 681 times.
✓ Branch 8 taken 1013 times.
✓ Branch 9 taken 352 times.
✓ Branch 14 taken 514 times.
✓ Branch 15 taken 270 times.
✓ Branch 20 taken 498 times.
✓ Branch 21 taken 201 times.
|
4826 | else if (eve::is_positive(e)) return os << " + " << e; |
| 26 | 1504 | else return os << " - " << -e; | |
| 27 | }; | ||
| 28 |
1/1✓ Branch 1 taken 3457 times.
|
15308 | kumi::for_each_index([&](auto i, auto v) { display_positive(os, v, i == 0); }, z); |
| 29 | 6825 | return os; | |
| 30 | } | ||
| 31 | |||
| 32 | //==================================================================================================================== | ||
| 33 | //! @} | ||
| 34 | //==================================================================================================================== | ||
| 35 | } | ||
| 36 |