0
  • Constraints 1<a,b<10^18.
  • Data Type : double
double a,b;
a=1000000000000000000;
b=999999999999999999;
cout<<ceil(a/b);

Output

1

Data Type : long double

long double a,b;
a=1000000000000000000;
b=999999999999999999;
cout<<ceil(a/b);

Output

2

Why do I geet different outputs?

Jabberwocky
  • 48,281
  • 17
  • 65
  • 115

0 Answers0