c中复数的算术运算 [英] Arithmetic operations of complex numbers in c

查看:88
本文介绍了c中复数的算术运算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对如何使用标准库在c语言中执行复数的算术运算感兴趣。例如:

I'm interested in how I can perform arithmetic operations of complex numbers in the c language using a standard library. For example:

#include <stdio.h>
#include <math.h>
#include <complex.h>

int main(int argc, char **argv)
{
    _Dcomplex a;
    _Dcomplex b = 2. + 3. * _Complex_I;
    _Dcomplex c = a + b;
    
    return 0;
}


谢谢你

Thanks

推荐答案

2017年3月24日下午2:33,Vite写道:

On 3/24/2017 2:33 PM, Vite wrote:


我对如何使用标准库在c语言中执行复数的算术运算感兴趣。例如:

I'm interested in how I can perform arithmetic operations of complex numbers in the c language using a standard library. For example:

如果我没记错的话,MSVC没有实现C99标准的这一部分。

If I recall correctly, MSVC does not implement this part of C99 standard.

任何理由你不能使用C ++和std :: complex吗?

Any reason you can't use C++ and std::complex?


这篇关于c中复数的算术运算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆