Commit Graph

8 Commits

Author SHA1 Message Date
ІО-23 Шмуляр Олег 71f04b9f60
improve upon stylistic choice of Mul function
The function seemed too crammed to me, so I made it look much more
spacious than before.

Signed-off-by: IO-23 Oleh Shmuliar <hasslesstech@tutanota.com>
2024-10-07 19:26:54 +03:00
Sergii Piatakov 8b7e818d3a add a multiplication operation
Add a member-function which performs multiplication of two float point
digits.

Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2024-10-07 19:23:14 +03:00
ІО-23 Шмуляр Олег 7c00e575e0 add two patches for respecting commits
Signed-off-by: IO-23 Oleh Shmuliar <hasslesstech@tutanota.com>
2024-10-07 19:18:42 +03:00
Sergii Piatakov b7e7566c43
squashing two commits together
---- Commit 1 ----
improve calculation accuracy

Allow using float point arguments to avoid truncation.

Test: Add (4.9, 4.9) should return 10.
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>

---- Commit 2 ----
fix truncation error

To convert float to integer the truncation is performed, but the
rounding is expected.

Test: Add (4.9, 4.9) should return 10.
Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>

Signed-off-by: IO-23 Oleh Shmuliar <hasslesstech@tutanota.com>
2024-10-07 19:12:20 +03:00
Sergii Piatakov 976f6913db add a subtraction operation
Add member-function which performs a subtraction in terms of
an addition.

Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-11-15 15:17:29 +02:00
Sergii Piatakov f03784b6c1 add header guard
The current implementation does not contain guard and it works well,
but it may lead to problems in the future.

Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-11-15 15:11:37 +02:00
Sergii Piatakov 997217087b basic implementation
Introduce the `Calculator` class with single member-function which
performs an addition.

Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-11-15 15:07:05 +02:00
Sergii Piatakov 75c0e7cb76 Initial commit
This commit is left empty intentionally.

Signed-off-by: Sergii Piatakov <sergii.piatakov@globallogic.com>
2018-11-15 13:13:59 +02:00