47 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// <random>10 11// template<class IntType = int>12// class binomial_distribution13 14// bool operator=(const binomial_distribution& x,15// const binomial_distribution& y);16// bool operator!(const binomial_distribution& x,17// const binomial_distribution& y);18 19#include <random>20#include <cassert>21 22#include "test_macros.h"23 24int main(int, char**)25{26 {27 typedef std::binomial_distribution<> D;28 D d1(3, .25);29 D d2(3, .25);30 assert(d1 == d2);31 }32 {33 typedef std::binomial_distribution<> D;34 D d1(3, .28);35 D d2(3, .25);36 assert(d1 != d2);37 }38 {39 typedef std::binomial_distribution<> D;40 D d1(3, .25);41 D d2(4, .25);42 assert(d1 != d2);43 }44 45 return 0;46}47