Mercurial > forge
comparison main/fixed/src/ov-fixed-complex.cc @ 9481:d84d2fea3c90 octave-forge
Re-enable compilation of fixed package
author | jordigh |
---|---|
date | Wed, 22 Feb 2012 22:07:33 +0000 |
parents | 0924c374b60d |
children | 58d36e8880db |
comparison
equal
deleted
inserted
replaced
9480:954f2f00d782 | 9481:d84d2fea3c90 |
---|---|
226 | 226 |
227 return retval; | 227 return retval; |
228 } | 228 } |
229 | 229 |
230 static void | 230 static void |
231 restore_precision (void *p) | 231 restore_precision (int *p) |
232 { | 232 { |
233 bind_internal_variable ("output_precision", *(static_cast<int *> (p))); | 233 bind_internal_variable ("output_precision", *p); |
234 } | 234 } |
235 | 235 |
236 void | 236 void |
237 octave_fixed_complex::print_raw (std::ostream& os, | 237 octave_fixed_complex::print_raw (std::ostream& os, |
238 bool pr_as_read_syntax) const | 238 bool pr_as_read_syntax) const |
243 std::imag(scalar.getdecsize())) | 243 std::imag(scalar.getdecsize())) |
244 + (min_num >= 1. ? (int)::log10(min_num) + 1 : 0); | 244 + (min_num >= 1. ? (int)::log10(min_num) + 1 : 0); |
245 | 245 |
246 octave_value_list tmp = feval ("output_precision"); | 246 octave_value_list tmp = feval ("output_precision"); |
247 int prec = tmp(0).int_value (); | 247 int prec = tmp(0).int_value (); |
248 unwind_protect::add (restore_precision, &prec); | 248 |
249 unwind_protect frame; | |
250 | |
251 frame.add_fcn (restore_precision, &prec); | |
252 | |
249 bind_internal_variable ("output_precision", new_prec); | 253 bind_internal_variable ("output_precision", new_prec); |
250 | 254 |
251 indent (os); | 255 indent (os); |
252 octave_print_internal (os, complex_value(), pr_as_read_syntax); | 256 octave_print_internal (os, complex_value(), pr_as_read_syntax); |
253 | |
254 unwind_protect::run (); | |
255 } | 257 } |
256 | 258 |
257 bool | 259 bool |
258 octave_fixed_complex::save_ascii (std::ostream& os) | 260 octave_fixed_complex::save_ascii (std::ostream& os) |
259 { | 261 { |