Mercurial > hg > octave-nkf
comparison examples/code/embedded.cc @ 20753:2f8500ca91d3
eliminate error_state from example files
* addtwomatrices.cc, celldemo.cc, embedded.cc, fortrandemo.cc,
funcdemo.cc, globaldemo.cc, helloworld.cc, make_int.cc, paramdemo.cc,
stringdemo.cc, structdemo.cc, unwinddemo.cc:
Eliminate use of global error_state variable.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 03 Oct 2015 16:05:27 -0400 |
parents | c8240a60dd01 |
children |
comparison
equal
deleted
inserted
replaced
20752:c547458dc10e | 20753:2f8500ca91d3 |
---|---|
19 for (octave_idx_type i = 0; i < n; i++) | 19 for (octave_idx_type i = 0; i < n; i++) |
20 in(i) = octave_value (5 * (i + 2)); | 20 in(i) = octave_value (5 * (i + 2)); |
21 | 21 |
22 octave_value_list out = feval ("gcd", in, 1); | 22 octave_value_list out = feval ("gcd", in, 1); |
23 | 23 |
24 if (! error_state && out.length () > 0) | 24 if (out.length () > 0) |
25 std::cout << "GCD of [" | 25 std::cout << "GCD of [" |
26 << in(0).int_value () | 26 << in(0).int_value () |
27 << ", " | 27 << ", " |
28 << in(1).int_value () | 28 << in(1).int_value () |
29 << "] is " << out(0).int_value () | 29 << "] is " << out(0).int_value () |