Adder is a small but usable subset of the Python language. It is named for the Blackadder comedy series, much as the Python language is named for Monty Python.
Add cases to valueOfBop for each of the valid combinations of arithmetic operator and operands. Note: Any combinations not covered by what you implement will simply be undefined.
[x] Addition of number / concatenation - adding two integers should produce an integer, adding a float with an integer or a float should produce a float, and adding two strings should produce a string`
[x] Subtraction of numbers - for result type, same rules as addition
[x] Multiplication of numbers - for result type, same rules as addition
[x] Division of numbers - always produces a float, regardless of whether operands are integers or floats
[x] Floor division - for result type, same rules as addition
[x] Exponentiation - for result type, same rules as addition
[x] Remainder - for result type, same rules as addition
Tip: Perhaps this should be split into multiple separate issues to be more easily divided up among several people.
@Marist-CMPT331-TOPL/students Depends on #35
Add cases to
valueOfBop
for each of the valid combinations of arithmetic operator and operands. Note: Any combinations not covered by what you implement will simply beundefined
.Tip: Perhaps this should be split into multiple separate issues to be more easily divided up among several people.