The Artima Developer Community
Sponsored Link

Java Answers Forum
Math.random()

1 reply on 1 page. Most recent reply: Feb 24, 2003 9:14 AM by Mike Penner

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Abdul Sattar

Posts: 1
Nickname: hisattar
Registered: Feb, 2003

Math.random() Posted: Feb 24, 2003 8:30 AM
Reply to this message Reply
Advertisement
Hi dear, I just want to ask about the internal procedure of Math.random()to give random number.
During calling this method, what thing is consider, Either memory address, time clock, etc of system.


Mike Penner

Posts: 16
Nickname: mikepenner
Registered: Jan, 2003

Re: Math.random() Posted: Feb 24, 2003 9:14 AM
Reply to this message Reply
Short answer: the clock.

Longer answer: In JDK1.3.1_03, Math.random() returns a value generated by a static instance of java.util.Random, whose zero-arg constructor uses the result of System.currentTimeMillis() as a seed.

Flat View: This topic has 1 reply on 1 page
Topic: reading in a csv  file Previous Topic   Next Topic Topic: simple problem but need help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use