From patchwork Mon Feb 4 20:26:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 218061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 665882C0348 for ; Tue, 5 Feb 2013 07:26:27 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1360614387; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=+on04GD4upHbieTa5K3lqdJOBJA=; b=YE+r4p2DOqvYX/P1nLDp+QlxHJ+dV1aWvOWWTsXIDBVzUS0oVDiIVV6OeWRTx4 3Z5Z5Tt7aDRv+GIQnKuw6hsNMOEEV5eg1TjbZQ6RSXFuP89j3V167bbAqZr4poWU 4hcBlXx/tUoQkiIMJDjGRNUD/zMNiKWDZzEMsFil6K/oU= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=aZZn/HASUYPbswThMkp0DMp/OSW06Kx3MctNuMlCpU+Bj2cmjj2/2Exgkid0ub PfzmBvDwHBqTJyBEMRITfQjY18pA+5HWIHX490GyPuRCOW/hT3ySjdNrJzr+grCZ q2aryDU4gg8SIj0mPLWTrWNwwUBySzaZ+zG21ZjMwC+ug=; Received: (qmail 15632 invoked by alias); 4 Feb 2013 20:26:22 -0000 Received: (qmail 15613 invoked by uid 22791); 4 Feb 2013 20:26:21 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Feb 2013 20:26:17 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r14KQGce002981 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 4 Feb 2013 20:26:17 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r14KQGQE018644 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Feb 2013 20:26:16 GMT Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r14KQFYi020187; Mon, 4 Feb 2013 14:26:16 -0600 Received: from [192.168.1.4] (/79.43.214.190) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 04 Feb 2013 12:26:15 -0800 Message-ID: <51101965.2080003@oracle.com> Date: Mon, 04 Feb 2013 21:26:13 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ Subject: Re: [v3] libstdc++/56202 References: <510FED5B.3010906@oracle.com> In-Reply-To: <510FED5B.3010906@oracle.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org ... committed this follow up. See Audit trail for details. Paolo. ////////////////// 2013-02-04 Manuel López-Ibáñez Paolo Carlini PR libstdc++/56202 (again) * include/bits/random.tcc (binomial_distribution<>:: _M_waiting(_UniformRandomNumberGenerator&, _IntType)): Fix thinko in previous commit. * include/bits/random.h: Fix comment typo. Index: include/bits/random.h =================================================================== --- include/bits/random.h (revision 195721) +++ include/bits/random.h (working copy) @@ -3770,7 +3770,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @brief A discrete binomial random number distribution. * * The formula for the binomial probability density function is - * @f$p(i|t,p) = \binom{n}{i} p^i (1 - p)^{t - i}@f$ where @f$t@f$ + * @f$p(i|t,p) = \binom{t}{i} p^i (1 - p)^{t - i}@f$ where @f$t@f$ * and @f$p@f$ are the parameters of the distribution. */ template Index: include/bits/random.tcc =================================================================== --- include/bits/random.tcc (revision 195722) +++ include/bits/random.tcc (working copy) @@ -1657,13 +1657,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION do { + if (__t == __x) + return __x; const double __e = -std::log(1.0 - __aurng()); - if (__t == __x) - { - if (__e) - return __x; - continue; - } __sum += __e / (__t - __x); __x += 1; }