double java.lang.Math.random()

송병훈·2022년 3월 21일
0

method

목록 보기
8/13

double java.lang.Math.random()


0.0 이상 1.0 미만인 양수인 실수 double형 값을 반환합니다. (1은 포함되지 않음)
반환되는 값은 해당 범위에서 (약) 균일한 분포를 사용하여 의사 난수로 선택됩니다.

반환값:
0.0 이상 1.0 미만의 double형 의사 난수.

참고 항목:
Random.next Double()


Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0. Returned values are chosen pseudorandomly with (approximately) uniform distribution from that range.

When this method is first called, it creates a single new pseudorandom-number generator, exactly as if by the expression

new java.util.Random()

This new pseudorandom-number generator is used thereafter for all calls to this method and is used nowhere else.

This method is properly synchronized to allow correct use by more than one thread. However, if many threads need to generate pseudorandom numbers at a great rate, it may reduce contention for each thread to have its own pseudorandom-number generator.

Returns:
a pseudorandom double greater than or equal to 0.0 and less than 1.0.

See Also:
Random.nextDouble()

profile
성실하고 꼼꼼하게

0개의 댓글