Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F85757671
operations.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Oct 1, 22:19
Size
567 B
Mime Type
text/x-c
Expires
Thu, Oct 3, 22:19 (2 d)
Engine
blob
Format
Raw Data
Handle
21263218
Attached To
R9360 PCSC_git
operations.cpp
View Options
#include <cmath>
int main(int argc, char *argv[]) {
int a = 5, b = 2, c;
c = a + b; // integer addition
c = a - b; // integer substraction
c = a * b; // integer multiplication
c = a / b; // integer division (careful!)
c = a % b; // modulo operation
double x = 1.0, y = 2.0, z;
z = (double)a / (double)b; // cast integer to a float
z = x / y; // floating point division
z = sqrt(x); // square root
z = exp(y); // exponential function
z = pow(x, y); // x to the power of y
z = M_PI; // z stores the value of pi
return 0;
}
Event Timeline
Log In to Comment