maciej-nowak / NM-Floatingpoint-Arithmetic

Basic operations on floating-point arithmetic. Created at the University as the project within Numerical Methods classes in 2014. The purpose of this project was to learn how computers calculate based on floating-point arithmetic.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NM-Floatingpoint-Arithmetic

Basic operations on floating-point arithmetic. Created at the University as the project within Numerical Methods classes in 2014. The purpose of this project was to learn how computers calculate based on floating-point arithmetic.

Example

For two given numbers in range <-14;15> the program returns numbers in arithmetic fl16. Also program calculate adding and multiplication of those numbers based only on arithmetic numbers (not decimal). Division is still not finished.

Example 1

A = 6, B = 2

INPUT: 6
ARITHMETIC: 0100011000000000
OUTPUT: 6

INPUT: 2
ARITHMETIC: 0100000000000000
OUTPUT: 2

ADDING: 8
MULTIPLICATION: 12

Example 2

A = -2, B = 4

INPUT: -2
ARITHMETIC: 1100000000000000
OUTPUT: -2

INPUT: 4
ARITHMETIC: 0100010000000000
OUTPUT: 4

ADDING: 2
MULTIPLICATION: -8

About

Basic operations on floating-point arithmetic. Created at the University as the project within Numerical Methods classes in 2014. The purpose of this project was to learn how computers calculate based on floating-point arithmetic.


Languages

Language:C++ 100.0%