Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6695037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:10:23+00:00 2026-05-26T06:10:23+00:00

I am curious, what average is obtained from this code snippet? The accumulator is

  • 0

I am curious, what average is obtained from this code snippet? The accumulator is intended to be empty.

boost::accumulators::accumulator_set<
    int,
    boost::accumulators::features<boost::accumulators::tag::mean>
> Accumulator;

int Mean = boost::accumulators::mean(Accumulator);

The average is non-zero when I test it. Is there some way I can tell that the average was taken for an empty data set? Why is the resulting value for “Mean” non-zero?

I was looking around in the documentation for the accumulator library, but was unable to find an answer to this question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:10:23+00:00Added an answer on May 26, 2026 at 6:10 am

    Any value would be a valid mean for an empty set of values. That is x * 0 = 0 holds for any x.

    You could add a count feature to your accumulator_set and query it to see if its 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Curious, what happens when you return keyword this from a struct in C#? For
Curious about things to consider to avoid any code breaks, etc to upgrade from
Curious what "Toast" means? Saw this and am curious... Similar Posts How to add
Curious as to how to approach this same problem using ruby / rails -
Curious how this could be done. Is there any way to create a delegate
Curious, what is the idea behind this: @() -as [bool] # False @($null) -as
I'm just curious if this could be done in a single LINQ statement. I
Curious about how developers more experienced with Django than I might handle this: I
Curious question. I'm using Microsoft's Sandcastle to generate documentation from the XML comments in
Just curious, when I imported data from a spreadsheet with 519 lines into an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.