Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #34913

Re: Will Math.random return 0.0?

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Will Math.random return 0.0?
Date 2016-07-16 12:49 -0400
Organization A noiseless patient Spider
Message-ID <nmdoj4$s2i$1@dont-email.me> (permalink)
References <rand-20160716162126@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 7/16/2016 11:24 AM, Stefan Ram wrote:
>   I wrote the following program.
>
> public final class Main
> { public static void main( final java.lang.String[] args )
>   { while( java.lang.Math.random() != 0.0 );
>     java.lang.System.out.println( "0.0" ); }}
>
>   What do you expect it's (average) runtime to be
>   on average hardware?

     Longer than my attention span.

>   Can we be sure that it will ever terminate?

     Yes.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: Will Math.random return 0.0? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-07-16 12:49 -0400
  Re: Will Math.random return 0.0? Thomas Richter <thor@math.tu-berlin.de> - 2016-07-16 18:53 +0200
    Re: Will Math.random return 0.0? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-07-16 13:11 -0400
      Re: Will Math.random return 0.0? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-07-17 08:06 -0400
    Re: Will Math.random return 0.0? Arne Vajhøj <arne@vajhoej.dk> - 2016-07-16 14:17 -0400

csiph-web