取幂运算符(缺乏) [英] exponentiation operator (lack of)

查看:75
本文介绍了取幂运算符(缺乏)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好奇:

为什么没有将原始取幂运算符添加到C99?

并且,是否有请求在下一个std版本中这样做?


理由这样做:

C和C ++越来越多地用于低级别的b $ b b数值计算,在新项目中取代Fortran。 />
检查,例如,sourceforge.net或freshmeat.net


但两种语言都没有提供原始的exp运算符。

^是独占的或者,这在数值计算中比在指数计算中少得多。但是,^^是开放的。

Curious:
Why wasnt a primitive exponentiation operator not added to C99?
And, are there requests to do so in the next std revision?

Justification for doing so:
C and C++ are increasingly used in low-level
numerical computations, replacing Fortran in newer projects.
Check, for example, sourceforge.net or freshmeat.net

But neither language offers a primitive exp operator.
^ is exclusive OR, which is much less common in numerical
programs than exponentiation. However, ^^ is open.

推荐答案

ca****@colorado.edu 写道:
好奇:
为什么原始取幂运算符没有添加到C99?
Curious:
Why wasnt a primitive exponentiation operator not added to C99?




您应该在发布之前阅读常见问题解答,这是有问题的答案

14.7,参见 http://www.eskimo.com/~scs/C-faq/q14.7.html 的答案。


Robert Gamble



You should read the FAQ before posting, this is answered in question
14.7, see http://www.eskimo.com/~scs/C-faq/q14.7.html for the answer.

Robert Gamble


这不是答案,只是一个借口。它将语言操作符链接到

是否存在硬件。 C不是汇编语言。

翻译是一种称为编译器的工作。

That is not an answer, just an excuse. It links language operators to
presence or absence of hardware. C is not assembly language.
Translation is the job of something called a compiler.


ca **** @ colorado.edu 写道:
这不是答案,只是一个借口。它将语言操作符链接到硬件的存在或不存在。 C不是汇编语言。
翻译是一种称为编译器的工作。
That is not an answer, just an excuse. It links language operators to
presence or absence of hardware. C is not assembly language.
Translation is the job of something called a compiler.



1)你没有引用足够的上下文 - 谷歌的

破坏Usenet界面是没有理由的。

2)你被引导回答 - 在常见问题解答中你应该有

阅读*在*询问你原来的问题之前。

3)这个新闻组主要关注ISO C语言,因为它是
*是*。如果你想让它变得与众不同,那么这个讨论的合适地点就是新闻:comp.std.c。


此外,我建议你做一些阅读C / $
语言的历史,为什么创建它,它的目的是什么等等。

可以提供对所做设计决策的深入了解。 />

HTH,

--ag

-

Artie Gold - 奥斯汀,德克萨斯州
http://goldsays.blogspot.com
< a rel =nofollowhref =http://www.cafepress.com/goldsaystarget =_ blank> http://www.cafepress.com/goldsays

如果你没有什么可隐瞒的,你就不会尝试!


1) You have failed to quote sufficient context -- for which Google''s
broken Usenet interface is no excuse.
2) You were directed to an answer -- in the FAQ, which you should have
read *before* asking your original question.
3) This newsgroup is primarily concerned with the ISO C language as it
*is*. If you want it to be different, the proper place for such
discussions is news:comp.std.c.

Further, I recommend you do some reading on the history of the C
language, why it was created, what was its intended purpose, etc. That
may provide insight into the design decisions made.

HTH,
--ag

--
Artie Gold -- Austin, Texas
http://goldsays.blogspot.com
http://www.cafepress.com/goldsays
"If you have nothing to hide, you''re not trying!"


这篇关于取幂运算符(缺乏)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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