Quick actions

cmd+k|ctrl+k

Navigation

Languages

Random numbers

Snippet info

Language

Ats

Visibility

public

Author

mindbound

Created

2016-11-14T20:28:42Z

Updated

2016-11-17T00:33:00Z

#include "share/atspre_staload.hats"

staload STDLIB = "libc/SATS/stdlib.sats"
staload TIME = "libc/SATS/time.sats"
staload UN = "prelude/SATS/unsafe.sats"

implement main0 () = () where
{
    val () = $STDLIB.srand48 ($UN.cast {lint} ($TIME.time_get ())) // seeding the RNG using current time
    val () = println! ($STDLIB.drand48 ())
}
INFO