Как вызвать мнимое число «i» в уравнении на C++? [закрыто]C++

Программы на C++. Форум разработчиков
Гость
Как вызвать мнимое число «i» в уравнении на C++? [закрыто]

Сообщение Гость »


Я хочу решить дифференциальное уравнение

Код: Выделить всё

idy/dx=x
using Euler method in C++, but i am not able to put i(iota) in the front of the equation.
I tried using

Код: Выделить всё

#include
,

Код: Выделить всё

 std::complex z = 1i;
and then writing

Код: Выделить всё

y[j+1]=y[j]+h*imag(z)*x[j]
, but this doesn't work. Please help. Also, note that the solution to this contains i(iota).


Источник: https://stackoverflow.com/questions/781 ... ation-in-c

Вернуться в «C++»