Math.floor / Math.ceil / Math.round
Math.floor() 내림값
Math.ceil() 올림값
Math.round() 반올림
_global.randomNumRange = function(min:Number, max:Number) {
//var r = Math.round(Math.random()*(max-min))+min;
var r = Math.floor(Math.random()*(max-min+1))+min
return r;
};
최소값과 최대값 사이에서 동일한 확률의 난수를 생성한다.
flash livedocs를 참조할 것.
About this entry
You’re currently reading “Math.floor / Math.ceil / Math.round,” an entry on multiplicité
- Published:
- Monday, June 13th, 2005 at 2:11 pm
- This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Korea.
- Author:
- vizualizer
- Category:
- techne
No comments
Jump to comment form | comments rss