Thread: Inverting Axis
View Single Post
  #16   Spotlight this post!  
Unread 02-02-2015, 14:09
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Inverting Axis

Quote:
Originally Posted by GeeTwo View Post
For an example where the simpler code is not easier to read:

Logically, you want to do a conditional:

if (c is between a and b, and you don't know whether a is larger or smaller than b) then...

Human simpler (use this!):

if ((a<b) && (b<c) || (a>b) && (b>c)) then..

Probably machine quicker, but don't use:

if ((a-b)*(b-c) > 0) then..
Either your code is wrong, or your prose description is.

I guess neither is simpler.


Reply With Quote