mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-22 21:31:19 +08:00
random.tcc (cauchy_distribution<>:: operator()(_UniformRandomNumberGenerator&, const param_type&)): Avoid M_PI, a glibc extension.
2009-05-14 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/random.tcc (cauchy_distribution<>:: operator()(_UniformRandomNumberGenerator&, const param_type&)): Avoid M_PI, a glibc extension. From-SVN: r147521
This commit is contained in:
parent
4d3aadab34
commit
e1a0296342
@ -1,3 +1,9 @@
|
||||
2009-05-14 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/bits/random.tcc (cauchy_distribution<>::
|
||||
operator()(_UniformRandomNumberGenerator&, const param_type&)):
|
||||
Avoid M_PI, a glibc extension.
|
||||
|
||||
2009-05-13 Ben Elliston <bje@au.ibm.com>
|
||||
|
||||
* include/Makefile.am (PCHFLAGS): Remove -Winvalid-pch.
|
||||
|
@ -1653,12 +1653,11 @@ namespace std
|
||||
__aurng(__urng);
|
||||
_RealType __u;
|
||||
do
|
||||
{
|
||||
__u = __aurng();
|
||||
}
|
||||
__u = __aurng();
|
||||
while (__u == 0.5);
|
||||
|
||||
return __p.a() + __p.b() * std::tan(M_PI * __u);
|
||||
const _RealType __pi = 3.1415926535897932384626433832795029L;
|
||||
return __p.a() + __p.b() * std::tan(__pi * __u);
|
||||
}
|
||||
|
||||
template<typename _RealType, typename _CharT, typename _Traits>
|
||||
|
Loading…
x
Reference in New Issue
Block a user