ios - Getting all decimals from interger being Squarooted -


the solution of square root of 11 in normal calculator

3.31662479036

i trying round 3.32

so problem having in ios is;

in viewdidload

int mynumber = sqrt(11); nslog(@"%d", mynumber); 

i keep getting 3 when should first 3 integers. can me solve this?

int integers, not decimals. use float , %f.

float mynumber = sqrtf(11); nslog(@"%.2f", mynumber); 

Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -