|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Min/Max Problems?
After days of staring blankly at four lines of seemingly flawless yet obviously disfunctional code, we discovered that the problem was in our MIN and MAX functions. Turns out MIN gives the max and MAX gives the min? Has anyone else had problems with this? Maybe that makes sense to some people, but doesn't it seem a bit backwards?
|
|
#2
|
|||||
|
|||||
|
umm... if thats hapening, then there is something wrong with your compiler or code. Why don't you post some of the faulty/questionable code so i can look it over?
-Kesich |
|
#3
|
|||||
|
|||||
|
Yeah, it seems kind of odd that MIN returns the maximum of the arguments while MAX returns the minimum, but it makes sense if you think about it in another way:
MIN sets the minimum allowable value of an expression to another value. MAX sets the maximum allowable value of an expression to another value. So if you do a = a + 1 MAX 127 then a will increment, but will never go higher than 127. Hope that helps you understand. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Do you all have problems with.... | Munkaboo | Website Design/Showcase | 19 | 03-03-2003 19:51 |
| EduRobotics problems | Ian Mackenzie | Robotics Education and Curriculum | 22 | 14-12-2002 11:33 |
| Joystick problems | archiver | 2001 | 3 | 24-06-2002 02:40 |
| Radio problems -- not | archiver | 2000 | 1 | 23-06-2002 22:23 |
| Speed Controller/PWM problems.... | Clark Gilbert | Technical Discussion | 8 | 08-01-2002 00:14 |