• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Algorithm help!!!

Kntx

Platinum Member
Hey guys,

I'm looking for an algorithm to determine if a number occurs between 2 others. The numbers can be positive or negative, and I don't know which is greater.

Any help?
 
N1,N2,Target

K1=Target - N1
K2=Target - N2

if k1 == 0 or k2==0 ) then return true
if (K1>0 and K2 < 0) or (k1<0 and K2 > 0) then return (true|false)
 
Back
Top