Opened 14 years ago

Closed 12 years ago

#2667 closed Patches (fixed)

linear_congruential operator>>()

Reported by: rick68@… Owned by: No-Maintainer
Milestone: Boost 1.38.0 Component: random
Version: Boost 1.37.0 Severity: Problem
Keywords: Cc:

Description

Hi,

In <boost/random/linear_congruential.hpp>

line122: template<class CharT, class Traits> line123: friend std::basic_istream<CharT,Traits>& line124: operator>>(std::basic_istream<CharT,Traits>& is, line125: linear_congruential& lcg) line126: { line127: return is >> lcg._x; line128: }

Input to lcg._x dose not mod with linear_congruential::modulus.

Attachments (1)

linear_congruential.hpp.diff (375 bytes ) - added by rick68@… 14 years ago.
Patch

Download all attachments as: .zip

Change History (3)

by rick68@…, 14 years ago

Patch

comment:1 by Steven Watanabe, 14 years ago

I don't think this is a bug. The input operator is only required to handle values that can be produced by the output operator.

comment:2 by Steven Watanabe, 12 years ago

Resolution: fixed
Status: newclosed

(In [62548]) Check for range errors in the input operator of linear_congruential. Fixes #2667

Note: See TracTickets for help on using tickets.