Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. // Note that there is no need for "using namespace std",
  2. // since no C++ standard libraries are used.
  3.  
  4. double addition(double left, double right) {
  5. return left + right;
  6. }
  7.  
  8.  
  9. double subtraction(double left, double right) {
  10. return left - right;
  11. }
  12.  
  13.  
  14. double multiplication(double left, double right) {
  15. return left * right;
  16. }
  17.  
  18.  
  19. double division(double left, double right) {
  20. return left / right;
  21. }
  22.  
  23. double exponentiation(double left, double right) {
  24. double calculation = 1;
  25. while (right > 0) {
  26. calculation = calculation * left;
  27. right -= 1;
  28. }
  29. return calculation;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement