Search found 1 match

by imnikey
01 Jun 2008, 11:50
Forum: Visual C++
Topic: Intrebare
Replies: 6
Views: 2650

Intrebare

De ce codul urmator nu imi da nr=2.88 ci 2.89?

double nr=0.9*3.2;
nr*=100;
nr=ceil(nr);
nr/=100;
cout<<nr<<endl;

Cum pot sa fac rotunjirea in plus a unui numar cu 2 zecimale? (Ex. rotunjire 42.4243 sa fie 42.43).
Codul e in vc++.