Files
2025-10-25 03:02:53 +03:00

54 lines
1.7 KiB
Markdown

[complex.literals]
# 29 Numerics library [[numerics]](./#numerics)
## 29.4 Complex numbers [[complex.numbers]](complex.numbers#complex.literals)
### 29.4.11 Suffixes for complex number literals [complex.literals]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1212)
This subclause describes literal suffixes for constructing complex number literals[.](#1.sentence-1)
The suffixes i, il, and if create complex numbers of
the types complex<double>, complex<long double>, andcomplex<float> respectively, with their imaginary part denoted by the
given literal number and the real part being zero[.](#1.sentence-2)
[🔗](#lib:operator%22%22il,complex)
`constexpr complex<long double> operator""il(long double d);
constexpr complex<long double> operator""il(unsigned long long d);
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1226)
*Returns*: complex<long double>{0.0L, static_cast<long double>(d)}[.](#2.sentence-1)
[🔗](#lib:operator%22%22i,complex)
`constexpr complex<double> operator""i(long double d);
constexpr complex<double> operator""i(unsigned long long d);
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1238)
*Returns*: complex<double>{0.0, static_cast<double>(d)}[.](#3.sentence-1)
[🔗](#lib:operator%22%22if,complex)
`constexpr complex<float> operator""if(long double d);
constexpr complex<float> operator""if(unsigned long long d);
`
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L1250)
*Returns*: complex<float>{0.0f, static_cast<float>(d)}[.](#4.sentence-1)