boostorg / random

Boost.org random module
http://boost.org/libs/random
34 stars 68 forks source link

Fix clang warning about tautological comparison. #67

Closed Lastique closed 4 years ago

Lastique commented 4 years ago

Use a more straightforward check for a negative value to silence clang warning:

../../../boost/random/linear_congruential.hpp:140:20: warning: overlapping comparisons always evaluate to false [-Wtautological-overlap-compare]
        if(_x <= 0 && _x != 0) {
           ~~~~~~~~^~~~~~~~~~

Here is an example.