xref: /llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.norm/rand.dist.norm.cauchy/max.pass.cpp (revision 24e1736d84fd0fb45097245706a523c3398beb69)
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // <random>
10 
11 // template<class RealType = double>
12 // class cauchy_distribution
13 
14 // result_type max() const;
15 
16 #include <random>
17 
18 #include <cassert>
19 #include <cmath>
20 
21 #include "test_macros.h"
22 
main(int,char **)23 int main(int, char**)
24 {
25     {
26         typedef std::cauchy_distribution<> D;
27         D d(5, .25);
28         D::result_type m = d.max();
29         assert(m == INFINITY);
30     }
31 
32   return 0;
33 }
34