diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-06-15 22:16:09 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-06-15 22:16:09 -0700 |
commit | ce9b2b0515eaf92a9c68c8608fd9bf392c941d50 (patch) | |
tree | eb1899f86308c712e54ef94a1c85243c26621c45 /022arithmetic.cc | |
parent | 0edd9b9fc60440213e4df926ea511419ee291f1e (diff) | |
download | mu-ce9b2b0515eaf92a9c68c8608fd9bf392c941d50.tar.gz |
4258 - undo 4257
Diffstat (limited to '022arithmetic.cc')
-rw-r--r-- | 022arithmetic.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/022arithmetic.cc b/022arithmetic.cc index 50a54578..530541aa 100644 --- a/022arithmetic.cc +++ b/022arithmetic.cc @@ -95,25 +95,18 @@ case SUBTRACT: { } break; } -:(code) -bool is_raw(const reagent& r) { - return has_property(r, "raw"); -} - :(before "End Primitive Recipe Implementations") case SUBTRACT: { - double result = scalar_ingredient(ingredients, 0); + double result = ingredients.at(0).at(0); for (int i = 1; i < SIZE(ingredients); ++i) - result -= scalar_ingredient(ingredients, i); + result -= ingredients.at(i).at(0); products.resize(1); products.at(0).push_back(result); break; } :(code) -double scalar_ingredient(const vector<vector<double> >& ingredients, int i) { - if (is_mu_address(current_instruction().ingredients.at(i))) - return ingredients.at(i).at(1); // skip alloc id - return ingredients.at(i).at(0); +bool is_raw(const reagent& r) { + return has_property(r, "raw"); } :(scenario subtract_literal) |