Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsTraceRefcntImpl.h File Reference
#include <stdio.h>
#include "nsITraceRefcnt.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  nsTraceRefcntImpl

Defines

#define NS_TRACE_REFCNT_CONTRACTID   "@mozilla.org/xpcom/trace-refcnt;1"
#define NS_TRACE_REFCNT_CLASSNAME   "nsTraceRefcnt Interface"
#define NS_TRACE_REFCNT_CID

Functions

NS_COM void NS_MeanAndStdDev (double n, double sumOfValues, double sumOfSquaredValues, double *meanResult, double *stdDevResult)

Define Documentation

Value:
{ /* e3e7511e-a395-4924-94b1-d527861cded4 */         \
    0xe3e7511e,                                      \
    0xa395,                                          \
    0x4924,                                          \
    {0x94, 0xb1, 0xd5, 0x27, 0x86, 0x1c, 0xde, 0xd4} \
}                                                    \

Definition at line 89 of file nsTraceRefcntImpl.h.

#define NS_TRACE_REFCNT_CLASSNAME   "nsTraceRefcnt Interface"

Definition at line 88 of file nsTraceRefcntImpl.h.

#define NS_TRACE_REFCNT_CONTRACTID   "@mozilla.org/xpcom/trace-refcnt;1"

Definition at line 87 of file nsTraceRefcntImpl.h.


Function Documentation

NS_COM void NS_MeanAndStdDev ( double  n,
double  sumOfValues,
double  sumOfSquaredValues,
double *  meanResult,
double *  stdDevResult 
)

Definition at line 45 of file TestWriteSpeed.cpp.

{
  double mean = 0.0, var = 0.0, stdDev = 0.0;
  if (n > 0.0 && sumOfValues >= 0) {
    mean = sumOfValues / n;
    double temp = (n * sumOfSquaredValues) - (sumOfValues * sumOfValues);
    if (temp < 0.0 || n <= 1)
      var = 0.0;
    else
      var = temp / (n * (n - 1));
    // for some reason, Windows says sqrt(0.0) is "-1.#J" (?!) so do this:
    stdDev = var != 0.0 ? sqrt(var) : 0.0;
  }
  *meanResult = mean;
  *stdDevResult = stdDev;
}

Here is the caller graph for this function: