diff --git a/libid/engine/calc_frac_init.cpp b/libid/engine/calc_frac_init.cpp index 52d77827e..130a9e891 100644 --- a/libid/engine/calc_frac_init.cpp +++ b/libid/engine/calc_frac_init.cpp @@ -131,7 +131,6 @@ void calc_frac_init() // initialize a *pile* of stuff for fractal calculation || g_debug_flag == DebugFlags::PREVENT_COORDINATE_GRID) { g_use_grid = false; - g_float_flag = true; } else { @@ -193,17 +192,9 @@ void calc_frac_init() // initialize a *pile* of stuff for fractal calculation { free_bf_vars(); } - g_float_flag = true; - if (g_user_std_calc_mode == 's') + if (g_user_std_calc_mode == 's' && g_fractal_type != FractalType::MANDEL) { - if (g_fractal_type == FractalType::MANDEL) - { - g_float_flag = true; - } - else - { - g_user_std_calc_mode = '1'; - } + g_user_std_calc_mode = '1'; } // cppcheck-suppress variableScope @@ -231,11 +222,6 @@ void calc_frac_init() // initialize a *pile* of stuff for fractal calculation g_distance_estimator = 0; // can't do distest too } - if (g_distance_estimator) - { - g_float_flag = true; // force floating point for dist est - } - assert(g_cur_fractal_specific == get_fractal_specific(g_fractal_type)); g_cur_fractal_specific = get_fractal_specific(g_fractal_type); @@ -351,7 +337,7 @@ void calc_frac_init() // initialize a *pile* of stuff for fractal calculation || ratio_bad((double)g_l_y1[(g_logical_screen_x_dots >> 1)-1], ((double)g_l_y_min-g_l_y_3rd)/2)) { expand_retry: - g_float_flag = true; // switch to floating pt + // switch to floating pt if (g_calc_status == CalcStatus::RESUMABLE) // due to restore of an old file? { g_calc_status = CalcStatus::PARAMS_CHANGED; // whatever, it isn't resumable diff --git a/libid/engine/calcfrac.cpp b/libid/engine/calcfrac.cpp index dc019c925..aacdc4f04 100644 --- a/libid/engine/calcfrac.cpp +++ b/libid/engine/calcfrac.cpp @@ -2501,23 +2501,14 @@ int potential(double mag, long iterations) } else // pot = log(mag) / pow(2.0, (double)pot); { - if (l_pot < 120 && !g_float_flag) // empirically determined limit of fShift + double d_tmp = std::log(mag) / (double) std::pow(2.0, (double) pot); + if (d_tmp > FLT_MIN) // prevent float type underflow { - float f_mag = (float) mag; - f_log14(f_mag, f_tmp); // this SHOULD be non-negative - f_shift(f_tmp, (char)-l_pot, pot); + pot = (float) d_tmp; } else { - double d_tmp = std::log(mag)/(double)std::pow(2.0, (double)pot); - if (d_tmp > FLT_MIN) // prevent float type underflow - { - pot = (float)d_tmp; - } - else - { - pot = 0.0F; - } + pot = 0.0F; } } @@ -2528,15 +2519,7 @@ int potential(double mag, long iterations) // potparam[2] -- rqlim value if changeable (bailout for modulus) if (pot > 0.0) { - if (g_float_flag) - { - pot = (float)std::sqrt((double)pot); - } - else - { - f_sqrt14(pot, f_tmp); - pot = f_tmp; - } + pot = (float) std::sqrt((double) pot); pot = (float)(g_potential_params[0] - pot*g_potential_params[1] - 1.0); } else diff --git a/libid/include/ui/cmdfiles.h b/libid/include/ui/cmdfiles.h index ae60e77fc..e2a291382 100644 --- a/libid/include/ui/cmdfiles.h +++ b/libid/include/ui/cmdfiles.h @@ -215,7 +215,6 @@ extern bool g_fast_restore; extern int g_fill_color; extern bool g_finite_attractor; extern bool g_first_init; -extern bool g_float_flag; extern std::string g_formula_filename; extern std::string g_formula_name; extern std::string g_gif_filename_mask; diff --git a/libid/io/encoder.cpp b/libid/io/encoder.cpp index d82dbe2b0..adc57b4d7 100644 --- a/libid/io/encoder.cpp +++ b/libid/io/encoder.cpp @@ -824,7 +824,7 @@ static void setup_save_info(FractalInfo *save_info) static_cast(g_three_pass && g_std_calc_mode == '3' ? 127 : g_std_calc_mode); save_info->dist_est_old = static_cast(g_distance_estimator <= 32000 ? g_distance_estimator : 32000); - save_info->float_flag = static_cast(g_float_flag ? 1 : 0); + save_info->float_flag = static_cast(1); save_info->bailout_old = static_cast(g_bailout >= 4 && g_bailout <= 32000 ? g_bailout : 0); save_info->calc_time = static_cast(g_calc_time); save_info->trig_index[0] = static_cast(g_trig_index[0]); diff --git a/libid/io/loadfile.cpp b/libid/io/loadfile.cpp index 02e40d6d7..981a236a1 100644 --- a/libid/io/loadfile.cpp +++ b/libid/io/loadfile.cpp @@ -1088,13 +1088,10 @@ int read_overlay() // read overlay/3D files, if reqr'd else { Display3DMode const old_display_ed = g_display_3d; - bool const old_float_flag2 = g_float_flag; g_display_3d = g_loaded_3d ? Display3DMode::YES : Display3DMode::NONE; // for display during next - g_float_flag = true; // ditto int i = get_video_mode(&read_info, &blk_3_info); driver_check_memory(); g_display_3d = old_display_ed; - g_float_flag = old_float_flag2; if (i) { if (blk_2_info.got_data) @@ -2263,7 +2260,6 @@ int file_get_window() free_bf_vars(); } g_bf_math = s_old_bf_math; - g_float_flag = true; return c; } diff --git a/libid/math/biginit.cpp b/libid/math/biginit.cpp index a87c40390..de6dfc81d 100644 --- a/libid/math/biginit.cpp +++ b/libid/math/biginit.cpp @@ -177,8 +177,6 @@ static void init_bf2() } } - g_float_flag = true; - // Now split up the memory among the pointers const auto alloc_size = [&ptr](int size) { diff --git a/libid/ui/cmdfiles.cpp b/libid/ui/cmdfiles.cpp index 1124dd73c..beb4ff984 100644 --- a/libid/ui/cmdfiles.cpp +++ b/libid/ui/cmdfiles.cpp @@ -122,7 +122,6 @@ bool g_potential_flag{}; // continuous potentia bool g_potential_16bit{}; // store 16 bit continuous potential values bool g_dither_flag{}; // true if we want to dither GIFs bool g_ask_video{}; // flag for video prompting -bool g_float_flag{true}; // int g_biomorph{}; // flag for biomorph int g_user_biomorph_value{}; // int g_show_file{}; // zero if file display pending diff --git a/libid/ui/tab_display.cpp b/libid/ui/tab_display.cpp index 001301983..0089c9381 100644 --- a/libid/ui/tab_display.cpp +++ b/libid/ui/tab_display.cpp @@ -339,28 +339,9 @@ int tab_display() // display the status of the current image // if (g_bf_math == bf_math_type::NONE) ++start_row; - int j = 0; - if (g_display_3d > Display3DMode::NONE) - { - j = 1; - } - else if (g_float_flag) - { - j = 1; - } - if (g_bf_math == BFMathType::NONE) { - if (j) - { - driver_put_string(start_row, 45, C_GENERAL_HI, "Floating-point"); - driver_put_string(-1, -1, C_GENERAL_HI, - (j == 1) ? " flag is activated" : " in use (required)"); - } - else - { - driver_put_string(start_row, 45, C_GENERAL_HI, "Integer math is in use"); - } + driver_put_string(start_row, 45, C_GENERAL_HI, "Floating-point in use"); } else {