Hello,
I am trying to run the following code (which is part of a larger program):
Code:
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <time.h>
#include <fstream>
#define rand01 (0.9999999*double(rand())/RAND_MAX)
#define getrandom(max1) (((rand())%(max1))) // random integer between 0 and max-1
using namespace std;
int main()
{
double result;
int sec = 2;
int t = 10;
result= 2.0*3.14*(46/1000)*(sec*1000.0+t);
cout << result << "\n";
return 0;
}
My output for result is "0." This is incorrect. Anyone have any ideas?
Thanks.