25 ms·
x/abs(x) is really sign, which is something you can implement using bitwise oprations. Your solution fails when price == 100 as sibling pointed out.
by carlob 13y ago
x/abs(x) is really sign, which is something you can implement using bitwise oprations.
Your solution fails when price == 100 as sibling pointed out.