Files
cppdraft_translate/cppdraft/complex/literals.md
2025-10-25 03:02:53 +03:00

1.7 KiB

[complex.literals]

29 Numerics library [numerics]

29.4 Complex numbers [complex.numbers]

29.4.11 Suffixes for complex number literals [complex.literals]

1

#

This subclause describes literal suffixes for constructing complex number literals.

The suffixes i, il, and if create complex numbers of the types complex, complex, andcomplex respectively, with their imaginary part denoted by the given literal number and the real part being zero.

🔗

constexpr complex<long double> operator""il(long double d); constexpr complex<long double> operator""il(unsigned long long d);

2

#

Returns: complex{0.0L, static_cast(d)}.

🔗

constexpr complex<double> operator""i(long double d); constexpr complex<double> operator""i(unsigned long long d);

3

#

Returns: complex{0.0, static_cast(d)}.

🔗

constexpr complex<float> operator""if(long double d); constexpr complex<float> operator""if(unsigned long long d);

4

#

Returns: complex{0.0f, static_cast(d)}.