xieite::pi<>

Defined in header <xieite/math/pi.hpp>

std::numbers::pi_v<> but also accepts integer types.


Declaration

#0
template<xieite::is_arith Arith = double>
constexpr Arith pi<Arith> = std::numbers::pi_v<Arith>;

#1
template<std::integral Int>
constexpr Int pi<Int> = static_cast<Int>(std::numbers::pi);


Example

int main() {
	std::println("{}", xieite::pi<int>);
}
Output:
3
[View in Compiler Explorer]