Variance and Standard Deviation

How to have shorter, better code

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

33 Replies - 103534 Views - Last Post: 15 June 2019 - 05:14 AM Rate Topic: -----

#31 Rolf99   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 16
  • Joined: 18-October 06

Re: Variance and Standard Deviation

Posted 17 November 2006 - 10:58 AM

View PostBitByte, on 17 Nov, 2006 - 07:11 AM, said:

Here is a link to explain a bit about namespaces:

C++ Faq Lite

You might want to have a read through that site, it's interesting.

You should also have a read on Bjarne Stroustrups homepage:

Bjarnes Homepage


Thaks,
an interesting solution with "using std::cout". I should try it, to avoid confusion or ambiguity, as they say. But knowing the names in the std library, would also be of use, to avoid double names. Unique names that I converted from your vector example like NameOfArray (I did it just to understand well, the concept of vectors, and saved it separatly) could be far from ambiguity. I should test both ways carefully before it's too late. Generaly clean is clean and clean code will almost never cause unwanted results. The learning effect from own mistakes could be the best teacher, but it's a long long road. I bookmarked Bjarnes Homepage, thanks again.

Rolf

This post has been edited by Rolf99: 17 November 2006 - 12:35 PM

Was This Post Helpful? 0
  • +
  • -

#32 Guest_Ali B*


Reputation:

Re: Variance and Standard Deviation

Posted 03 April 2010 - 11:13 PM

See an implementation for SUM (sum), AVG (average), MIN (minimum), MAX (maximum), STDEV (standard deviation), and VAR (variance) here:

http://mycodelog.com...7/c-aggregates/
Was This Post Helpful? 0

#33 impactidris   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-June 19

Re: Variance and Standard Deviation

Posted 14 June 2019 - 09:30 PM

Thanks guys. This page was really helpful for one of my projects.
Was This Post Helpful? 0
  • +
  • -

#34 CTphpnwb   User is online

  • D.I.C Lover
  • member icon

Reputation: 3822
  • View blog
  • Posts: 13,915
  • Joined: 08-August 08

Re: Variance and Standard Deviation

Posted 15 June 2019 - 05:14 AM

If you're going to think at all about std::cout then it seems to me that you should be obsessed with USING FUNCTIONS at least, or possibly classes. The OP has written a list of instructions, not a program! Let's see some structure in the code.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3