# HG changeset patch # User Rik # Date 1569111422 25200 # Node ID 57f5c5768eb35be92e6abf5da66e1b8a6f9ecd86 # Parent fc7504df6a125f1af1417535df217ad0fb1d8fee Disallow exponential format in combination with fixed_point_format. * pr-output.cc (pr_float, pr_scale_header): Add test for "! print_e" to existing test for "! print_g" to disable fixed_point_format when either format is in use. diff -r fc7504df6a12 -r 57f5c5768eb3 libinterp/corefcn/pr-output.cc --- a/libinterp/corefcn/pr-output.cc Fri Sep 20 21:47:53 2019 -0700 +++ b/libinterp/corefcn/pr-output.cc Sat Sep 21 17:17:02 2019 -0700 @@ -1416,7 +1416,7 @@ { double scale = fmt.scale_factor (); - if (Vfixed_point_format && ! print_g && scale != 1) + if (Vfixed_point_format && ! (print_g || print_e) && scale != 1) val /= scale; pr_any_float (os, fmt.real_format (), val); @@ -1442,7 +1442,7 @@ T scale = static_cast (dscale); std::complex tmp - = ((Vfixed_point_format && ! print_g && scale != 1) + = ((Vfixed_point_format && ! (print_g || print_e) && scale != 1) ? cval / scale : cval); T r = tmp.real (); @@ -1513,7 +1513,7 @@ static inline void pr_scale_header (std::ostream& os, double scale) { - if (Vfixed_point_format && ! print_g && scale != 1) + if (Vfixed_point_format && ! (print_g || print_e) && scale != 1) { octave::preserve_stream_state stream_state (os);