What does the integer suffix J mean?

喜欢而已 提交于 2019-11-30 16:46:23

I get a warning:

Imaginary constants are a GNU extension

The J suffix is a GNU extension, which causes the literal to be of a _Complex type.

More info here: https://gcc.gnu.org/onlinedocs/gcc/Complex.html

As zenith mentioned, this is a GNU extension for writing imaginary literals. I really want to comment on the rationale of using j for this purpose as imallett is wondering but I don't have enough reputation to comment on zenith's answer. I'll leave this as an answer anyway as it might be helpful to others.

As this link explains, both i and j can be used to write imaginary literals using this GNU extension. The reason why i is used for this is obvious, but the reason why j is used as well is that j is commonly used to denote the imaginary unit in electrical engineering and control systems engineering to prevent confusion as i is already used to denote electrical current in those contexts.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!