7 kyu
Binary Calculator
797 of 2,868lkspencer
Description:
In this kata you need to write a function that will receive two strings (n1
and n2
), each representing an integer as a binary number. A third parameter will be provided (o
) as a string representing one of the following operators: add, subtract, multiply.
Your task is to write the calculate function so that it will perform the arithmetic and the result returned should be a string representing the binary result.
Examples:
1 + 1 === 10
10 + 10 === 100
Negative binary numbers are usually preceded by several 1's. For this kata, negative numbers can be represented with the negative symbol at the beginning of the string.
Examples of negatives:
1 - 10 === -1
10 - 100 === -10
Binary
Algorithms
Similar Kata:
Stats:
Created | Nov 18, 2014 |
Published | Nov 18, 2014 |
Warriors Trained | 6882 |
Total Skips | 857 |
Total Code Submissions | 14081 |
Total Times Completed | 2868 |
JavaScript Completions | 869 |
Python Completions | 797 |
Ruby Completions | 245 |
Java Completions | 853 |
Swift Completions | 206 |
Total Stars | 93 |
% of votes with a positive feedback rating | 91% of 379 |
Total "Very Satisfied" Votes | 317 |
Total "Somewhat Satisfied" Votes | 53 |
Total "Not Satisfied" Votes | 9 |