Re:How We Beat C++ STL Binary Search
by Joky on Tuesday August 11, 2015 @07:28PM
(#10045077)
I believe there is a standard cross-platform maximum value, and you mention it in your last sentence: std::numeric_limits!
[ Parent
| on HN ]
Uhm... Using "-1" to assign the maximum value is in fact as standard and cross-platform as using std::numeric_limits, which was basically my entire point.
The difference between those is only "textual solution" VS "mathematical solution" and thus a matter of personal preference.