You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In doing so, they are doing the exact opposite of what anyone who has ever used max and min functions in other languages will expect them to do.
In other programming/scripting languages, the max function returns the maximum value (i.e. the biggest) of a given set and min returns the minimum (the smallest) number of a given set.
I bet that everyone who scripts some SourcePawn and uses the functions provided here will be very confused about the results, then start debugging their code and at some point read the source code of the functions - and then be even more confused about why they are "inverted" and pull their hair out.
I agree to both of that, although I think deprecating them and finding a new naming scheme is preferable to leaving it as it is. Either way, maybe this issue will pop up on google for people who are looking for a min/max function in SP/SM and help reduce confusion...
In smlib,
Math_Min()
returns the biggest of two given numbers andMath_Max()
returns the smallest of two given numbers:smlib/scripting/include/smlib/math.inc
Lines 53 to 85 in aad2c8e
In doing so, they are doing the exact opposite of what anyone who has ever used max and min functions in other languages will expect them to do.
In other programming/scripting languages, the max function returns the maximum value (i.e. the biggest) of a given set and min returns the minimum (the smallest) number of a given set.
I bet that everyone who scripts some SourcePawn and uses the functions provided here will be very confused about the results, then start debugging their code and at some point read the source code of the functions - and then be even more confused about why they are "inverted" and pull their hair out.
The text was updated successfully, but these errors were encountered: