Skip to content

TAKMU/division_substraction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

division_substraction

Made by ALLAN KEN MIYAZONO USHIJIMA

This project was made becauser for an assignment.

The main importance in doing this division by substraction is to remember the possible inputs and outputs.

Since it is a division, we can consider that the 2 inputs (dividend and divisor) can be either positive (consider including 0) and negative. And the output will depend on the type of number that it is input(positive or negative).

We can determine that the output is going to behave the same as an xor (for the output to be negative only one of the inputs has to be negative). Considering the point above, I made two functions:

-One that serves as a flag that detects if a number is negative

-Another to multiply the number by -1 (with the objective to make the division function only with positive numbers and transform either the result or the residue to negatives to output the proper answer).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages