在iOS開發當中。。。我們往往會涉及到一些算法。。。為了節省一些時間。。。讓APP很快地被開發出來。。。我們需要對各類函數有一定的了解。。。接下來。。。我把部分常用函數分享出來。。。希望能幫到大家。。。????????????
rand() ----隨機數
abs() / labs() ----整數絕對值
fabs() / fabsf() / fabsl() ----浮點數絕對值
floor() / floorf() / floorl() ----向下取整
ceil() / ceilf() / ceill() ----向上取整
round() / roundf() / roundl() ----四舍五入
sqrt() / sqrtf() / sqrtl() ----求平方根
fmax() / fmaxf() / fmaxl() ----求最大值
fmin() / fminf() / fminl() ----求最小值
hypot() / hypotf() / hypotl() ----求直角三角形斜邊的長度
fmod() / fmodf() / fmodl() ----求兩數整除后的余數
modf() / modff() / modfl() ----浮點數分解為整數和小數
frexp() / frexpf() / frexpl() ----浮點數分解尾數和二為底的指數
sin() / sinf() / sinl() ----求正弦值
sinh() / sinhf() / sinhl() ----求雙曲正弦值
cos() / cosf() / cosl() ----求余弦值
cosh() / coshf() / coshl() ----求雙曲余弦值
tan() / tanf() / tanl() ----求正切值
tanh() / tanhf() / tanhl() ----求雙曲正切值
asin() / asinf() / asinl() ----求反正弦值
asinh() / asinhf() / asinhl() ----求反雙曲正弦值
acos() / acosf() / acosl() ----求反余弦值
acosh() / acoshf() / acoshl() ----求反雙曲余弦值
atan() / atanf() / atanl() ----求反正切值
atan2() / atan2f() / atan2l() ----求坐標值的反正切值
atanh() / atanhf() / atanhl() ----求反雙曲正切值