-
-
Notifications
You must be signed in to change notification settings - Fork 417
Msvc nan inf #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Msvc nan inf #355
Changes from 1 commit
98bda80
628e04b
2d3d0ba
6ea13bc
6de92e6
4c97b17
7aed313
cbbb42e
4a915f7
4f75c29
abea61c
4478942
a24d946
69d32cd
2236aa6
fb134e0
d1caa3e
57a6ed1
5696858
bfb3f12
6357415
e0b7170
af03bf1
ceb1d12
f76f205
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -524,7 +524,7 @@ int kdtree_knn(struct kdtree *t, double *c, int *uid, double *d, int k, int *ski | |
| if (skip) | ||
| sn.uid = *skip; | ||
|
|
||
| maxdist = 1.0 / 0.0; | ||
| sscanf("inf", "%lf", &maxdist); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use |
||
| found = 0; | ||
|
|
||
| /* go down */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -252,7 +252,9 @@ int Vect_get_line_box(const struct Map_info *Map, int line, struct bound_box *Bo | |
|
|
||
| Line = Plus->Line[line]; | ||
| if (Line == NULL) { /* dead */ | ||
| Box->N = Box->S = Box->E = Box->W = Box->T = Box->B = 0. / 0.; | ||
| double nan_val; | ||
| sscanf("-nan", "%lf", &nan_val); | ||
| Box->N = Box->S = Box->E = Box->W = Box->T = Box->B = nan_val; | ||
|
Comment on lines
+255
to
+257
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use Line = Plus->Line[line];
if (Line == NULL) { /* dead */
Box->N = Box->S = Box->E = Box->W = Box->T = Box->B = NAN;
return 0;
} |
||
| return 0; | ||
| } | ||
|
|
||
|
|
@@ -317,7 +319,9 @@ int Vect_get_area_box(const struct Map_info *Map, int area, struct bound_box *Bo | |
| Area = Plus->Area[area]; | ||
|
|
||
| if (Area == NULL) { /* dead */ | ||
| Box->N = Box->S = Box->E = Box->W = Box->T = Box->B = 0. / 0.; | ||
| double nan_val; | ||
| sscanf("-nan", "%lf", &nan_val); | ||
| Box->N = Box->S = Box->E = Box->W = Box->T = Box->B = nan_val; | ||
|
Comment on lines
+322
to
+324
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use if (Area == NULL) { /* dead */
Box->N = Box->S = Box->E = Box->W = Box->T = Box->B = NAN;
return 0;
} |
||
| return 0; | ||
| } | ||
|
|
||
|
|
@@ -363,7 +367,9 @@ int Vect_get_isle_box(const struct Map_info *Map, int isle, struct bound_box *Bo | |
| Isle = Plus->Isle[isle]; | ||
|
|
||
| if (Isle == NULL) { /* dead */ | ||
| Box->N = Box->S = Box->E = Box->W = Box->T = Box->B = 0. / 0.; | ||
| double nan_val; | ||
| sscanf("-nan", "%lf", &nan_val); | ||
| Box->N = Box->S = Box->E = Box->W = Box->T = Box->B = nan_val; | ||
|
Comment on lines
+370
to
+372
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use Isle = Plus->Isle[isle];
if (Isle == NULL) { /* dead */
Box->N = Box->S = Box->E = Box->W = Box->T = Box->B = NAN;
return 0;
} |
||
| return 0; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -773,7 +773,7 @@ double horizon_height(void) | |
| { | ||
| double height; | ||
|
|
||
| tanh0 = -1.0 / 0.0; /* -inf */ | ||
| sscanf("-inf", "%lf", &tanh0); /* -inf */ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| length = 0; | ||
|
|
||
| height = searching(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -228,7 +228,8 @@ int main(int argc, char *argv[]) | |
| const char *outpre; | ||
| char output[GNAME_MAX]; | ||
| const char *title; | ||
| double null_val = 0.0/0.0; | ||
| double null_val; | ||
| sscanf("-nan", "%lf", &null_val); | ||
|
Comment on lines
+231
to
+232
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, it has been changed to |
||
| int is_fp; | ||
| int is_signed; | ||
| int bytes, hbytes; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,7 +103,9 @@ int scan_bounds(LASReaderH LAS_reader, int shell_style, int extents, int update, | |
| first = TRUE; | ||
|
|
||
| /* init to nan in case no points are found */ | ||
| min_x = max_x = min_y = max_y = min_z = max_z = 0.0 / 0.0; | ||
| double nan_val; | ||
| sscanf("-nan", "%lf", &nan_val); | ||
| min_x = max_x = min_y = max_y = min_z = max_z = nan_val; | ||
|
Comment on lines
+106
to
+108
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, it has been changed to use /* init to nan in case no points are found */
min_x = max_x = min_y = max_y = min_z = max_z = NAN; |
||
|
|
||
| G_verbose_message(_("Scanning data ...")); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -315,8 +315,8 @@ int calculate(int fd, struct area_entry *ad, double *result) | |
| (((NS_DIST1 + NS_DIST2) / 2) / hd.rows); | ||
|
|
||
| /* get min and max patch size */ | ||
| min = 1.0 / 0.0; /* inf */ | ||
| max = -1.0 / 0.0; /* -inf */ | ||
| sscanf("inf", "%lf", &min); /* inf */ | ||
| sscanf("-inf", "%lf", &max); /* -inf */ | ||
|
Comment on lines
+318
to
+319
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use min = INFINITY;
max = -INFINITY; |
||
| for (old_pid = 1; old_pid <= pid; old_pid++) { | ||
| if (pst[old_pid].count > 0) { | ||
| area_p = cell_size_m * pst[old_pid].count / 10000; | ||
|
|
@@ -551,8 +551,8 @@ int calculateD(int fd, struct area_entry *ad, double *result) | |
| (((NS_DIST1 + NS_DIST2) / 2) / hd.rows); | ||
|
|
||
| /* get min and max patch size */ | ||
| min = 1.0 / 0.0; /* inf */ | ||
| max = -1.0 / 0.0; /* -inf */ | ||
| sscanf("inf", "%lf", &min); /* inf */ | ||
| sscanf("-inf", "%lf", &max); /* -inf */ | ||
|
Comment on lines
+554
to
+555
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use min = INFINITY;
max = -INFINITY; |
||
| for (old_pid = 1; old_pid <= pid; old_pid++) { | ||
| if (pst[old_pid].count > 0) { | ||
| area_p = cell_size_m * pst[old_pid].count / 10000; | ||
|
|
@@ -787,8 +787,8 @@ int calculateF(int fd, struct area_entry *ad, double *result) | |
| (((NS_DIST1 + NS_DIST2) / 2) / hd.rows); | ||
|
|
||
| /* get min and max patch size */ | ||
| min = 1.0 / 0.0; /* inf */ | ||
| max = -1.0 / 0.0; /* -inf */ | ||
| sscanf("inf", "%lf", &min); /* inf */ | ||
| sscanf("-inf", "%lf", &max); /* -inf */ | ||
|
Comment on lines
+790
to
+791
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use min = INFINITY;
max = -INFINITY; |
||
| for (old_pid = 1; old_pid <= pid; old_pid++) { | ||
| if (pst[old_pid].count > 0) { | ||
| area_p = cell_size_m * pst[old_pid].count / 10000; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -895,6 +895,8 @@ int nodataval_check(double nodataval, GDALDataType datatype) | |
|
|
||
| double set_default_nodata_value(GDALDataType datatype, double min, double max) | ||
| { | ||
| double nan_val; | ||
| sscanf("-nan", "%lf", &nan_val); | ||
|
Comment on lines
+898
to
+899
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the returns have been changed to use |
||
| switch (datatype) { | ||
| case GDT_Byte: | ||
| if (max < TYPE_BYTE_MAX) | ||
|
|
@@ -940,11 +942,11 @@ double set_default_nodata_value(GDALDataType datatype, double min, double max) | |
|
|
||
| case GDT_Float32: | ||
| case GDT_CFloat32: | ||
| return 0.0 / 0.0; | ||
| return nan_val; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, it has been changed to use case GDT_Float32:
case GDT_CFloat32:
return NAN; |
||
|
|
||
| case GDT_Float64: | ||
| case GDT_CFloat64: | ||
| return 0.0 / 0.0; | ||
| return nan_val; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, it has been changed to use case GDT_Float64:
case GDT_CFloat64:
return NAN; |
||
|
|
||
| default: | ||
| return 0; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,8 +169,8 @@ int main(int argc, char *argv[]) | |
| if (G_parser(argc, argv)) | ||
| exit(EXIT_FAILURE); | ||
|
|
||
| lo = -1.0 / 0.0; /* -inf */ | ||
| hi = 1.0 / 0.0; /* inf */ | ||
| sscanf("-inf", "%lf", &lo); | ||
| sscanf("inf", "%lf", &hi); | ||
|
Comment on lines
+172
to
+173
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use lo = -INFINITY;
hi = INFINITY; |
||
|
|
||
| method = METHOD_GDD; | ||
| if (G_strncasecmp(parm.method->answer, "gdd", 3) == 0) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,8 +194,9 @@ int main(int argc, char *argv[]) | |
| if (G_parser(argc, argv)) | ||
| exit(EXIT_FAILURE); | ||
|
|
||
| lo = -1.0 / 0.0; /* -inf */ | ||
| hi = 1.0 / 0.0; /* inf */ | ||
| sscanf("-inf", "%lf", &lo); | ||
| sscanf("inf", "%lf", &hi); | ||
|
|
||
|
Comment on lines
+197
to
+199
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use lo = -INFINITY;
hi = INFINITY; |
||
| if (parm.range->answer) { | ||
| lo = atof(parm.range->answers[0]); | ||
| hi = atof(parm.range->answers[1]); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,9 +132,10 @@ int main(int argc, char *argv[]) | |
|
|
||
| /* table field separator */ | ||
| zone_info.sep = G_option_to_separator(param.separator); | ||
|
|
||
| zone_info.min = 0.0 / 0.0; /* set to nan as default */ | ||
| zone_info.max = 0.0 / 0.0; /* set to nan as default */ | ||
| double nan_val; | ||
| sscanf("-nan", "%lf", &nan_val); | ||
| zone_info.min = nan_val; /* set to nan as default */ | ||
| zone_info.max = nan_val; /* set to nan as default */ | ||
|
Comment on lines
+135
to
+138
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use only /* table field separator */
zone_info.sep = G_option_to_separator(param.separator);
zone_info.min = 0;
zone_info.max = 0;
zone_info.n_zones = 0; |
||
| zone_info.n_zones = 0; | ||
|
|
||
| fdz = -1; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -132,10 +132,10 @@ int main(int argc, char *argv[]) | |
| /* table field separator */ | ||
| zone_info.sep = G_option_to_separator(param.separator); | ||
|
|
||
| dmin = 0.0 / 0.0; /* set to nan as default */ | ||
| dmax = 0.0 / 0.0; /* set to nan as default */ | ||
| zone_info.min = 0.0 / 0.0; /* set to nan as default */ | ||
| zone_info.max = 0.0 / 0.0; /* set to nan as default */ | ||
| sscanf("-nan", "%lf", &dmin); /* set to nan as default */ | ||
| sscanf("-nan", "%lf", &dmax); /* set to nan as default */ | ||
| sscanf("-nan", "%lf", &zone_info.min); /* set to nan as default */ | ||
| sscanf("-nan", "%lf", &zone_info.max); /* set to nan as default */ | ||
|
Comment on lines
+135
to
+138
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use /* table field separator */
zone_info.sep = G_option_to_separator(param.separator);
dmin = NAN;
dmax = NAN;
zone_info.min = 0;
zone_info.max = 0;
zone_info.n_zones = 0; |
||
| zone_info.n_zones = 0; | ||
|
|
||
| /* open 3D zoning raster with default region */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,8 @@ univar_stat *create_univar_stat_struct(int map_type, int n_perc) | |
| univar_stat *stats; | ||
| int i; | ||
| int n_zones = zone_info.n_zones; | ||
|
|
||
| double nan_val; | ||
| sscanf("-nan", "%lf", &nan_val); | ||
|
Comment on lines
+24
to
+25
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the returns have been changed to use |
||
| if (n_zones == 0) | ||
| n_zones = 1; | ||
|
|
||
|
|
@@ -30,8 +31,8 @@ univar_stat *create_univar_stat_struct(int map_type, int n_perc) | |
| for (i = 0; i < n_zones; i++) { | ||
| stats[i].sum = 0.0; | ||
| stats[i].sumsq = 0.0; | ||
| stats[i].min = 0.0 / 0.0; /* set to nan as default */ | ||
| stats[i].max = 0.0 / 0.0; /* set to nan as default */ | ||
| stats[i].min = nan_val; /* set to nan as default */ | ||
| stats[i].max = nan_val; /* set to nan as default */ | ||
|
Comment on lines
+34
to
+35
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use for (i = 0; i < n_zones; i++) {
stats[i].sum = 0.0;
stats[i].sumsq = 0.0;
stats[i].min = NAN;
stats[i].max = NAN; |
||
| stats[i].n_perc = n_perc; | ||
| if (n_perc > 0) | ||
| stats[i].perc = (double *)G_malloc(n_perc * sizeof(double)); | ||
|
|
@@ -105,7 +106,8 @@ void free_univar_stat_struct(univar_stat * stats) | |
| int print_stats(univar_stat * stats) | ||
| { | ||
| int z, n_zones = zone_info.n_zones; | ||
|
|
||
| double nan_val; | ||
| sscanf("-nan", "%lf", &nan_val); | ||
|
Comment on lines
+109
to
+110
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the returns have been changed to use |
||
| if (n_zones == 0) | ||
| n_zones = 1; | ||
|
|
||
|
|
@@ -127,8 +129,9 @@ int print_stats(univar_stat * stats) | |
| stdev = sqrt(variance); | ||
| var_coef = (stdev / mean) * 100.; /* perhaps stdev/fabs(mean) ? */ | ||
|
|
||
| if (stats[z].n == 0) | ||
| stats[z].sum = stats[z].sum_abs = 0.0 / 0.0; | ||
| if (stats[z].n == 0) { | ||
| stats[z].sum = stats[z].sum_abs = nan_val; | ||
| } | ||
|
Comment on lines
+132
to
+134
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use if (stats[z].n == 0)
stats[z].sum = stats[z].sum_abs = NAN; |
||
| sprintf(sum_str, "%.15g", stats[z].sum); | ||
| G_trim_decimal(sum_str); | ||
|
|
||
|
|
@@ -182,9 +185,9 @@ int print_stats(univar_stat * stats) | |
| quartile_perc = (double *)G_calloc(stats[z].n_perc, sizeof(double)); | ||
|
|
||
| if (stats[z].n == 0) { | ||
| quartile_25 = median = quartile_75 = 0.0 / 0.0; | ||
| quartile_25 = median = quartile_75 = nan_val; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use if (stats[z].n == 0) {
quartile_25 = median = quartile_75 = NAN;
for (i = 0; i < stats[z].n_perc; i++)
quartile_perc[i] = NAN;
} |
||
| for (i = 0; i < stats[z].n_perc; i++) | ||
| quartile_perc[i] = 0.0 / 0.0; | ||
| quartile_perc[i] = nan_val; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use if (stats[z].n == 0) {
quartile_25 = median = quartile_75 = NAN;
for (i = 0; i < stats[z].n_perc; i++)
quartile_perc[i] = NAN;
} |
||
| } | ||
| else { | ||
| for (i = 0; i < stats[z].n_perc; i++) { | ||
|
|
@@ -308,7 +311,8 @@ int print_stats_table(univar_stat * stats) | |
| { | ||
| unsigned int i; | ||
| int z, n_zones = zone_info.n_zones; | ||
|
|
||
| double nan_val; | ||
| sscanf("-nan", "%lf", &nan_val); | ||
|
Comment on lines
+314
to
+315
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the returns have been changed to use |
||
| if (n_zones == 0) | ||
| n_zones = 1; | ||
|
|
||
|
|
@@ -378,7 +382,7 @@ int print_stats_table(univar_stat * stats) | |
| var_coef = (stdev / mean) * 100.; /* perhaps stdev/fabs(mean) ? */ | ||
|
|
||
| if (stats[z].n == 0) | ||
| stats[z].sum = stats[z].sum_abs = 0.0 / 0.0; | ||
| stats[z].sum = stats[z].sum_abs = nan_val; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use if (stats[z].n == 0)
stats[z].sum = stats[z].sum_abs = NAN; |
||
|
|
||
| if (zone_info.n_zones) { | ||
| int z_cat = z + zone_info.min; | ||
|
|
@@ -424,9 +428,9 @@ int print_stats_table(univar_stat * stats) | |
|
|
||
|
|
||
| if (stats[z].n == 0) { | ||
| quartile_25 = median = quartile_75 = 0.0 / 0.0; | ||
| quartile_25 = median = quartile_75 = nan_val; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use if (stats[z].n == 0) {
quartile_25 = median = quartile_75 = NAN;
for (i = 0; i < stats[z].n_perc; i++)
quartile_perc[i] = NAN;
} |
||
| for (i = 0; i < stats[z].n_perc; i++) | ||
| quartile_perc[i] = 0.0 / 0.0; | ||
| quartile_perc[i] = nan_val; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use if (stats[z].n == 0) {
quartile_25 = median = quartile_75 = NAN;
for (i = 0; i < stats[z].n_perc; i++)
quartile_perc[i] = NAN;
} |
||
| } | ||
| else { | ||
| for (i = 0; i < stats[z].n_perc; i++) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,7 +104,9 @@ int scan_bounds(LASReaderH LAS_reader, int shell_style, int extents, int update, | |
| first = TRUE; | ||
|
|
||
| /* init to nan in case no points are found */ | ||
| min_x = max_x = min_y = max_y = min_z = max_z = 0.0 / 0.0; | ||
| double nan_val; | ||
| sscanf("-nan", "%lf", &nan_val); | ||
| min_x = max_x = min_y = max_y = min_z = max_z = nan_val; | ||
|
Comment on lines
+107
to
+109
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use /* init to nan in case no points are found */
min_x = max_x = min_y = max_y = min_z = max_z = NAN; |
||
|
|
||
| G_verbose_message(_("Scanning data ...")); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -264,7 +264,7 @@ int main(int argc, char *argv[]) | |
| c[2] = 0.0; | ||
| n = 0; | ||
| sum = sumsq = 0; | ||
| min = 1.0 / 0.0; | ||
| sscanf("inf", "%lf", &min); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use min = INFINITY; |
||
| max = 0; | ||
| kd = G_malloc(minpnts * sizeof(double)); | ||
| ki = G_malloc(minpnts * sizeof(int)); | ||
|
|
@@ -469,7 +469,7 @@ int main(int argc, char *argv[]) | |
| c[2] = 0.0; | ||
| n = 0; | ||
| sum = sumsq = 0; | ||
| min = 1.0 / 0.0; | ||
| sscanf("inf", "%lf", &min); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use min = INFINITY; |
||
| max = 0; | ||
| kd = G_malloc(minpnts * sizeof(double)); | ||
| ki = G_malloc(minpnts * sizeof(int)); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,9 @@ int get_line_box(const struct line_pnts *Points, | |
| int i; | ||
|
|
||
| if (Points->n_points == 0) { | ||
| box->E = box->W = box->N = box->S = box->T = box->B = 0.0 / 0.0; | ||
| double nan_val; | ||
| sscanf("-nan", "%lf", &nan_val); | ||
| box->E = box->W = box->N = box->S = box->T = box->B = nan_val; | ||
|
Comment on lines
+15
to
+17
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use if (Points->n_points == 0) {
box->E = box->W = box->N = box->S = box->T = box->B = NAN;
return 0;
} |
||
| return 0; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -525,7 +525,7 @@ int tie_up(void) | |
| IPoints[i]); | ||
| } | ||
|
|
||
| distmin = 1. / 0.; /* +inf */ | ||
| sscanf("inf", "%lf", &distmin); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #2681, the code was changed to use distmin = INFINITY; |
||
| xmin = x; | ||
| ymin = y; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #2681, the code was changed to use
NAN, but there's a note that some of them won't work for MSVC (at that time), but it was not mentioned for the NAN change.