text.cc (8634:8390f2d80227) text.cc (8666:97d873b8b13e)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 353 unchanged lines hidden (view full) ---

362 print.name = base + "samples";
363 print.value = data.samples;
364 print(stream);
365
366 print.name = base + "mean";
367 print.value = data.samples ? data.sum / data.samples : NAN;
368 print(stream);
369
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 353 unchanged lines hidden (view full) ---

362 print.name = base + "samples";
363 print.value = data.samples;
364 print(stream);
365
366 print.name = base + "mean";
367 print.value = data.samples ? data.sum / data.samples : NAN;
368 print(stream);
369
370 if (data.type == Hist) {
371 print.name = base + "gmean";
372 print.value = data.samples ? exp(data.logs / data.samples) : NAN;
373 print(stream);
374 }
375
370 Result stdev = NAN;
371 if (data.samples)
372 stdev = sqrt((data.samples * data.squares - data.sum * data.sum) /
373 (data.samples * (data.samples - 1.0)));
374 print.name = base + "stdev";
375 print.value = stdev;
376 print(stream);
377

--- 312 unchanged lines hidden ---
376 Result stdev = NAN;
377 if (data.samples)
378 stdev = sqrt((data.samples * data.squares - data.sum * data.sum) /
379 (data.samples * (data.samples - 1.0)));
380 print.name = base + "stdev";
381 print.value = stdev;
382 print(stream);
383

--- 312 unchanged lines hidden ---