• Forum
  • Lounge
  • reference bug report : normal_distributi

 
reference bug report : normal_distribution::min()

http://www.cplusplus.com/reference/random/normal_distribution/min/

This says follow:

Return value
numeric_limits<result_type>::min()

Return value should be

-numeric_limits<result_type>::infinity()

Boost.Random and libc++ implementation return -infinity().
Unfortunately, libstdc++ return min(). I already reported bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58098
@OP
I'm curious why you think this is a bug, std draft n3337 section 26.5.16 table 118 - Random number distribution requirements says min() returns glb (greatest lower bound). I didn't see anything specific to normal_distribution so this may not apply.
The special thing about normal_distribution is that its parameter type is double by default, and greatest lower bound is numeric_limits<double>::lowest(), not numeric_limits<double>::min().
@Catfish4
Thank you for report link. I'll report the bug.

@naraku9333
numeric_limits<double>::min() means positive minimum value (not -max()). double's minimum value is numeric_limits<double>::lowest().
Last edited on
Topic archived. No new replies allowed.