help C++
Hi,
I am new about C++. I want to calculate some functions in my programme, such as sin, cos, power, log, etc. Where can I find their expression in C++? Thanks! |
Re: help C++
You can find intrinsic functions (sin, min, exp, etc.) in the various include files available with the compiler you're using. Such as:
#include <math.h> |
once more
oops - The symbols I typed didn't show up last time. More explicitly, the syntax is:
#include (less than sign)math.h(greater than sign) |
Re: once more
Thank you very much.
I have good fortran knowledge. In #include <math.h>, how to express squared or power calculation? |
Re: once more
Hi, an example #include <cmath> #include <iostream> int main(void) { double a=10; // take e^a std::cout << exp(a) << std::endl; // take a^10 std::cout << pow(a,10) << std::endl; // take sinus(a) std::cout << sin(a) << std::endl; } M. http://panoramix.ift.uni.wroc.pl/~maq
|
Re: once more
Thank you very much.
I just try it. It is clear. |
All times are GMT -4. The time now is 04:18. |