• Forum
  • Lounge
  • reference bug report : normal_distributi

reference bug report : normal_distribution::min()


This says follow:

Return value

Return value should be


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
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().
Thank you for report link. I'll report the bug.

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.