Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 6th, 2006, 8:23 PM   #1
Vinaaron
Newbie
 
Join Date: Jan 2006
Posts: 6
Rep Power: 0 Vinaaron is on a distinguished road
Exclamation Positive Difference in HLA

We are currently using High level Assembly.
And our instructors gave us an exercise to find using only addition and subtraction command,i.e. add() and sub(); the problem is to find the positive difference between two numbers without using any control structures like if() and loops; only addition and subtraction that is..
I know this is only trivial but if there already availabel ideas, then why not use them...?
Hope you could help..
Vinaaron is offline   Reply With Quote
Old Jan 6th, 2006, 8:29 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
The point of this task is for you to learn to solve programming-oriented problems. Now how, exactly, are you supposed to learn this if we do your work for you?

Think a little. Prove you've done some work. Then come back and we'd be more than happy to help.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jan 6th, 2006, 8:38 PM   #3
Vinaaron
Newbie
 
Join Date: Jan 2006
Posts: 6
Rep Power: 0 Vinaaron is on a distinguished road
I've done all possible combination of addition and subtraction but to no avail.
Well if this is trivial if control structures are allowed..Already thought, but all I got is negative to positive, then positive to negative.
We are not even allowed to manipulate the bit representation of the numbers to be manipulated..well I think youre right, I am just being idle on my part..I'll think again..
__________________
Contented with little, yet wishing for more..
Vinaaron is offline   Reply With Quote
Old Jan 6th, 2006, 8:43 PM   #4
Navid
Hobbyist Programmer
 
Navid's Avatar
 
Join Date: Feb 2005
Location: Canada
Posts: 187
Rep Power: 4 Navid is on a distinguished road
Send a message via MSN to Navid
Are you trying to find the absolute of a sum or subtraction?
Navid is offline   Reply With Quote
Old Jan 6th, 2006, 8:55 PM   #5
Vinaaron
Newbie
 
Join Date: Jan 2006
Posts: 6
Rep Power: 0 Vinaaron is on a distinguished road
..the subtraction
__________________
Contented with little, yet wishing for more..
Vinaaron is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:46 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC