Opened 9 years ago

Closed 9 years ago

#8850 closed Patches (fixed)

Patch for spurious warning at boost/accumulators/statistics/p_square_quantile.hpp(72)

Reported by: Gareth Sylvester-Bradley <gareth.sylvester-bradley@…> Owned by: Eric Niebler
Milestone: To Be Determined Component: accumulator
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc: Gareth, Sylvester-Bradley, <gareth.sylvester-bradley@…>

Description

When building with Visual Studio 2012 (msvc-11.0), 64-bit, I got a 27 kB warning message at the head of which was:

boost/accumulators/statistics/p_square_quantile.hpp(72): warning C4244: '=' : conversion from 'size_t' to 'double', possible loss of data

The offending line 72 and a possible one-character patch would seem to be:

-                this->actual_positions[i] = i + 1;
+                this->actual_positions[i] = i + 1.;

A code snippet that demonstrates the warning:

#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/median.hpp>

boost::accumulators::accumulator_set< double, boost::accumulators::stats< boost::accumulators::tag::median > > median_accumulator;

Change History (3)

comment:1 by Eric Niebler, 9 years ago

(In [85122]) fix msvc warning, refs #8850

comment:2 by Eric Niebler, 9 years ago

Status: newassigned

Fixed on trunk, will close when merged to release. Thanks.

comment:3 by Eric Niebler, 9 years ago

Resolution: fixed
Status: assignedclosed

(In [85424]) merge [85122],[85123],[85124] from trunk to release; fixes #7915, fixes #8850, fixes #8262

Note: See TracTickets for help on using tickets.