Thread: How to code?
View Single Post
  #1493 (permalink)  
Old 12-10-2008, 04:39 PM
fercan fercan is offline
Member
 
Join Date: Aug 2008
Posts: 36
fercan is on a distinguished road
how do you simplify this code?

the difference between a and b <= c then trade = true, else false..

so far this is what i have made if anyone can show me a shorter way to code this..

if ( a >= b)
{
if (a - b <= c ) trade = true;
if (a - b > c) trade = false;
}
if ( a < b)
{
if (b - a <= c ) trade = true;
if (b - a > c) trade = false;
}

Last edited by fercan; 12-10-2008 at 04:41 PM.
Reply With Quote