diff --git a/src/topmodel.c b/src/topmodel.c index 25757c8..38d071c 100755 --- a/src/topmodel.c +++ b/src/topmodel.c @@ -612,15 +612,16 @@ extern void calc_time_delay_histogram(int max_time_delay_ordinates, int num_chan } + // casting tch[num_channels] to int truncates tch[num_channels] + // (e.g., 7.9 becomes 7) (*num_time_delay_histo_ords)=(int)tch[num_channels]; - // why is this necessary with the line above that defines num_time_delay_histo_ords? - // was included in original fortran code, so could be related to older fortran behavior? + // this is here to round up. Since casting tch as int effectively rounds down, + // we add a value of 1 effectively rounding up. if((double)(*num_time_delay_histo_ords)