This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Need to know what code to use to take an average

Hello, I am trying to find out how to write a program which will take the average over the day. I dont want it to just take the average over the last 24 hours, I know how to do that, rather I want to find the average from 12 midnight to 12 midnight the next day, and to have this average displayed throughout the day and changing as the day progresses. This is to be written in C code

Parents
  • I find it really hard to understand how you could, as you claim, know how to do a rolling average, but not a fixed-interval one. The latter is not just easier, it's a special case of the former.

    So either your claim is wrong, or your task description is misleading. So let's clarify it by you answering some questions:

    * The average over which data interval is supposed to be displayed at 05:30h, early Tuesday morning?

    * ... and the average over which, at 22:00h Wednesday night?

Reply
  • I find it really hard to understand how you could, as you claim, know how to do a rolling average, but not a fixed-interval one. The latter is not just easier, it's a special case of the former.

    So either your claim is wrong, or your task description is misleading. So let's clarify it by you answering some questions:

    * The average over which data interval is supposed to be displayed at 05:30h, early Tuesday morning?

    * ... and the average over which, at 22:00h Wednesday night?

Children
No data