Hi list,
Am I missing something or is it a bug ? :
search(({ 1, 2, 3 }), 5);
Compiler Error: 1:Bad argument 2 to search. Compiler Error: 1:Expected: function(string, string | int, void | int : int) | function(array((0=mixed)), 0, void | int : int) | function(mapping((1=mixed):(2=mixed)), 2, void | 1 : 1) | !(function(!array, mixed, void | int : mixed) | function(!mapping, mixed, void | int : mixed)) & function(mapping | array, mixed, void | int : zero) Compiler Error: 1:Got : function(array(int(1..3)), int(5..5) : void | mixed)
search(({ 1, 2, 3 }), 1);
(1) Result: 0
search(({ 1, 2, 3 }), -8);
(2) Result: -1
Search returns an error when I search for something which is greater than the greater element of the array. It does this with either Pike 7.2 or 7.4.
Thank you for your answers.