실수를 줄이기 위한 randBool 함수 추가

This commit is contained in:
2018-02-09 02:11:58 +09:00
parent 191226289d
commit 4b414c0879
+8
View File
@@ -24,6 +24,14 @@ function randF(){
return mt_rand() / mt_getrandmax();
}
/**
* $prob의 확률로 true를 반환
* @return boolean
*/
function randBool($prob = 0.5){
return randF() < $prob;
}
/**
* 로그인한 유저의 전역 id를 받아옴
*