Opened 12 years ago

Closed 9 years ago

#5493 closed Patches (wontfix)

Replaces literal pi by boost::math::constants::pi<>()

Reported by: Júlio Hoffimann <julio.hoffimann@…> Owned by: Steven Watanabe
Milestone: To Be Determined Component: random
Version: Boost 1.47.0 Severity: Cosmetic
Keywords: Cc: blelbach@…

Description

This patch replaces the literal pi in gamma, normal and Cauchy distributions by the math::constants defined in Boost.

Attachments (3)

cauchy_dist.patch (246 bytes ) - added by Júlio Hoffimann <julio.hoffimann@…> 12 years ago.
gamma_dist.patch (252 bytes ) - added by Júlio Hoffimann <julio.hoffimann@…> 12 years ago.
normal_dist.patch (246 bytes ) - added by Júlio Hoffimann <julio.hoffimann@…> 12 years ago.

Download all attachments as: .zip

Change History (9)

by Júlio Hoffimann <julio.hoffimann@…>, 12 years ago

Attachment: cauchy_dist.patch added

by Júlio Hoffimann <julio.hoffimann@…>, 12 years ago

Attachment: gamma_dist.patch added

by Júlio Hoffimann <julio.hoffimann@…>, 12 years ago

Attachment: normal_dist.patch added

comment:1 by Bryce Adelstein Lelbach, 12 years ago

Cc: blelbach@… added
Owner: changed from No-Maintainer to John Maddock

comment:2 by Bryce Adelstein Lelbach, 12 years ago

Owner: changed from John Maddock to Steven Watanabe

comment:3 by John Maddock, 11 years ago

I wonder if this really makes any difference? The precision of the value of pi in a random number generator is presumably not so important?

comment:4 by Júlio Hoffimann <julio.hoffimann@…>, 11 years ago

Hi John,

This is the reason i tagged the patch as "cosmetic". Use literal values, it's not good practice as we know.

Regards, Júlio.

in reply to:  3 comment:5 by Steven Watanabe, 11 years ago

Replying to johnmaddock:

I wonder if this really makes any difference? The precision of the value of pi in a random number generator is presumably not so important?

The Random library only works with float, double, and long double anyway. I had to make some adjustments to test with NTL and I didn't keep those changes.

comment:6 by Steven Watanabe, 9 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.