Skip to content

Bug: negative numbers do not work #4

@ghost

Description

The the difference is always positive when subtracting.

Steps to reproduce:

% ./AddNums
Lets do some Math on two numbers
What type of operation would you like to perform
Add, Sub
Sub
Enter First Number:
-12
Enter Two Number:
4
Holly Shizzz the two Numbers EQUAL 08

% ./AddNums
Lets do some Math on two numbers
What type of operation would you like to perform
Add, Sub
Sub
Enter First Number:
10
Enter Two Number:
11
Holly Shizzz the two Numbers EQUAL 01

Also Add seems to completely ignore negative operands:

% ./AddNums
Lets do some Math on two numbers
What type of operation would you like to perform
Add, Sub
Add
Enter First Number:
-1
Enter Two Number:
2
Holly Shizzz the two Numbers EQUAL 03

I think this forum post helps us solve this critical bug:

http://www.ibmmainframeforum.com/ibm-cobol/topic11039.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions