pike.git
/
src
/
operators.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/operators.c:3740:
if(call_lfun(LFUN_MULTIPLY, LFUN_RMULTIPLY)) return; PIKE_ERROR("`*", "Bad arguments.\n", sp, 2); } }
+
+
/*! @decl object|int|float `**(object|int|float arg1, object|int|float arg2)
+
*!
+
*! Exponentiation. Raise arg1 to the power of arg2.
+
*!
+
*/
PMOD_EXPORT void f_exponent(INT32 args) { double a, b; if(args != 2 ) SIMPLE_WRONG_NUM_ARGS_ERROR("`**",2); switch( TWO_TYPES(TYPEOF(sp[-2]), TYPEOF(sp[-1])) ) { case TWO_TYPES(T_FLOAT,T_FLOAT):
pike.git/src/operators.c:3780:
return; } } /* When float overflows, switch to bignums. FIXME: mpf? */ /* fallthrough */ default: stack_swap(); convert_stack_top_to_bignum(); stack_swap();
-
/* fallthrough again (
le
slow path).. */
+
/* fallthrough again (
this
is the
slow path).. */
+
case TWO_TYPES(T_OBJECT,T_INT): case TWO_TYPES(T_OBJECT,T_OBJECT):
-
if( !call_lfun( LFUN_POW, LFUN_
POW
) )
+
if( !call_lfun( LFUN_POW, LFUN_
RPOW
) )
Pike_error("Illegal argument 1 to `**.\n"); return; }
-
+
} /*! @decl mixed `*(mixed arg1) *! @decl mixed `*(object arg1, mixed arg2, mixed ... extras) *! @decl mixed `*(mixed arg1, object arg2) *! @decl array `*(array arg1, int arg2) *! @decl array `*(array arg1, float arg2) *! @decl string `*(string arg1, int arg2) *! @decl string `*(string arg1, float arg2)