I am dividing 2 long values and use the ceiling of the result. However my code produces wrong output.
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main(){
long first = 100;
long second = 1000;
long output = ceil(first/second);
cout<<"output = "<<output<<endl;
}
Here the expected output is
output = 1
actual output:
output = 0