Home | History | Annotate | Download | only in rand.dist.uni.real
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <random>
     11 
     12 // template<class RealType = double>
     13 // class uniform_real_distribution
     14 
     15 // explicit uniform_real_distribution(RealType a = 0,
     16 //                                    RealType b = 1);
     17 
     18 #include <random>
     19 #include <cassert>
     20 
     21 int main()
     22 {
     23     {
     24         typedef std::uniform_real_distribution<> D;
     25         D d;
     26         assert(d.a() == 0);
     27         assert(d.b() == 1);
     28     }
     29     {
     30         typedef std::uniform_real_distribution<> D;
     31         D d(-6);
     32         assert(d.a() == -6);
     33         assert(d.b() == 1);
     34     }
     35     {
     36         typedef std::uniform_real_distribution<> D;
     37         D d(-6, 106);
     38         assert(d.a() == -6);
     39         assert(d.b() == 106);
     40     }
     41 }
     42