天天看點

iOS開發的一些函數算法

留着必有後用

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() ----求反雙曲正切值

繼續閱讀