pike.git / src / modules / _math / math.c

version» Context lines:

pike.git/src/modules/_math/math.c:527:    *!    *! Return the absolute value for @[f]. If @[f] is    *! an object it must implement @[lfun::`<] and    *! unary @[lfun::`-].    */   void f_abs(INT32 args)   {    struct svalue zero;    SET_SVAL(zero, T_INT, NUMBER_NUMBER, integer, 0);    -  check_all_args("abs",args,BIT_INT|BIT_FLOAT|BIT_OBJECT,0); +  check_all_args(NULL,args,BIT_INT|BIT_FLOAT|BIT_OBJECT,0);    pop_n_elems(args-1);    if(is_lt(sp-1,&zero)) o_negate();   }      /*! @decl int sgn(mixed value)    *! @decl int sgn(mixed value, mixed zero)    *!    *! Check the sign of a value.    *!    *! @returns    *! Returns @expr{-1@} if @[value] is less than @[zero],    *! @expr{1@} if @[value] is greater than @[zero] and @expr{0@}    *! (zero) otherwise.    *!    *! @seealso    *! @[abs()]    */   void f_sgn(INT32 args)   {    TRIM_STACK(2); -  check_all_args("sgn",args,BIT_MIXED,BIT_VOID|BIT_MIXED,0); +  check_all_args(NULL,args,BIT_MIXED,BIT_VOID|BIT_MIXED,0);    if(args<2)    push_int(0);       if(is_lt(sp-2,sp-1))    {    pop_n_elems(2);    push_int(-1);    }    else if(is_gt(sp-2,sp-1))    {