Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Histogram
comparison Histogram.c @ 4:83a412f2ef98
Added stdio.h and copy-paste error on FreeDblHist to FreeFloatHist
| author | Me |
|---|---|
| date | Tue, 02 Nov 2010 16:47:21 -0700 |
| parents | 3d35477a5121 |
| children | a2388fae93ff |
comparison
equal
deleted
inserted
replaced
| 1:60428bf5ba01 | 2:cf93e95a4804 |
|---|---|
| 3 * Licensed under GNU General Public License version 2 | 3 * Licensed under GNU General Public License version 2 |
| 4 * | 4 * |
| 5 * Author: seanhalle@yahoo.com | 5 * Author: seanhalle@yahoo.com |
| 6 * | 6 * |
| 7 */ | 7 */ |
| 8 | 8 #include <stdio.h> |
| 9 #include "Histogram.h" | 9 #include "Histogram.h" |
| 10 | 10 |
| 11 | 11 |
| 12 /*This Histogram Abstract Data Type has a number of bins plus a range of | 12 /*This Histogram Abstract Data Type has a number of bins plus a range of |
| 13 * values that the bins span, both chosen at creation. | 13 * values that the bins span, both chosen at creation. |
| 72 { | 72 { |
| 73 if( maxHeight < hist->bins[ i ] ) maxHeight = hist->bins[ i ]; | 73 if( maxHeight < hist->bins[ i ] ) maxHeight = hist->bins[ i ]; |
| 74 } | 74 } |
| 75 barValue = maxHeight / 60; //60 spaces across page for tallest bin | 75 barValue = maxHeight / 60; //60 spaces across page for tallest bin |
| 76 | 76 |
| 77 printf("histogram: \n"); | 77 printf( "histogram: \n" ); |
| 78 if( barValue == 0 ) printf("error printing histogram\n"); | 78 if( barValue == 0 ) printf("error printing histogram\n"); |
| 79 for( binIdx = 0; binIdx < hist->numBins; binIdx++ ) | 79 for( binIdx = 0; binIdx < hist->numBins; binIdx++ ) |
| 80 { | 80 { |
| 81 binStart = hist->startOfRange + hist->binWidth * binIdx; | 81 binStart = hist->startOfRange + hist->binWidth * binIdx; |
| 82 binEnd = binStart + hist->binWidth - 1; | 82 binEnd = binStart + hist->binWidth - 1; |
