floating-point promotion : stroustrup vs compiler - who is right?

后端 未结 2 452
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-06 23:05

In section 10.5.1 of Stroustrup\'s new book \"The C++ Programming Language - Fourth Edition\" he says, that before an arithmetic operation is performed, integral promotion is us

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-06 23:18

    In the meantime Stroustrup seems to recognised the refer sentence is not correct or at least misleading. He has removed the sentence, about the floating-point promotion, from section 10.5.1.

    Please see errata of 3rd printing of 4th edition on Stroustrup's web page:

    pg 267: s/Similarly, floating-point promotion is used to create doubles out of floats//

    (Remark: The expression s/regexp/replacement/ is similar to sed unix tool semantics. It searches for the pattern regexp and replaces it with replacement. Nothing in our case.)

提交回复
热议问题