diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-02-19 17:00:39 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-02-19 17:00:39 -0800 |
commit | e2d57bfec90a578d6545dff0059cc6050d21c573 (patch) | |
tree | 8484239ada718adc60dc2fc0d4ed6e21917cf9b6 | |
parent | 98f7918bddaaaef6b4f59a66a632a475c24105ac (diff) | |
download | mu-e2d57bfec90a578d6545dff0059cc6050d21c573.tar.gz |
791
-rw-r--r-- | cpp/013arithmetic | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cpp/013arithmetic b/cpp/013arithmetic index 7aca4264..47d14b2c 100644 --- a/cpp/013arithmetic +++ b/cpp/013arithmetic @@ -13,7 +13,7 @@ case ADD: { vector<int> arg1 = read_memory(p->ingredients[1]); assert(arg1.size() == 1); vector<int> result; - result.push_back(arg0[0]+arg1[0]); + result.push_back(arg0[0] + arg1[0]); trace("run") << "product 0 is " << result[0]; write_memory(p->products[0], result); break; @@ -57,7 +57,7 @@ case SUBTRACT: { vector<int> arg1 = read_memory(p->ingredients[1]); assert(arg1.size() == 1); vector<int> result; - result.push_back(arg0[0]-arg1[0]); + result.push_back(arg0[0] - arg1[0]); trace("run") << "product 0 is " << result[0]; write_memory(p->products[0], result); break; @@ -102,7 +102,7 @@ case MULTIPLY: { assert(arg1.size() == 1); trace("run") << "ingredient 1 is " << arg1[0]; vector<int> result; - result.push_back(arg0[0]*arg1[0]); + result.push_back(arg0[0] * arg1[0]); trace("run") << "product 0 is " << result[0]; write_memory(p->products[0], result); break; @@ -147,7 +147,7 @@ case DIVIDE: { assert(arg1.size() == 1); trace("run") << "ingredient 1 is " << arg1[0]; vector<int> result; - result.push_back(arg0[0]/arg1[0]); + result.push_back(arg0[0] / arg1[0]); trace("run") << "product 0 is " << result[0]; write_memory(p->products[0], result); break; @@ -191,11 +191,11 @@ case DIVIDE_WITH_REMAINDER: { vector<int> arg1 = read_memory(p->ingredients[1]); assert(arg1.size() == 1); vector<int> result0; - result0.push_back(arg0[0]/arg1[0]); + result0.push_back(arg0[0] / arg1[0]); trace("run") << "product 0 is " << result0[0]; write_memory(p->products[0], result0); vector<int> result1; - result1.push_back(arg0[0]%arg1[0]); + result1.push_back(arg0[0] % arg1[0]); trace("run") << "product 1 is " << result1[0]; write_memory(p->products[1], result1); break; |