How to raise a double value by power of 12?

后端 未结 5 1087
谎友^
谎友^ 2020-12-11 06:49

I have a double which is:

double mydouble = 10;

and I want 10^12, so 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10. I tried

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 07:02

    I couldn't even get the program to compile without:

    #include 
    

    When using math functions like this you should ALWAYS include math.h and make sure you are calling the right pow function. Who knows what the other pow function might be ... it could stand for "power wheels" haha

提交回复
热议问题