Extracted from Pike v7.3 release 18 at 2002-03-27.
pike.roxen.com
[Top]

Method `*()


Method `*

mixed `*(mixed arg1)
mixed `*(object arg1, mixed arg2, mixed ... extras)
mixed `*(mixed arg1, object arg2)
array `*(array arg1, int arg2)
array `*(array arg1, float arg2)
string `*(string arg1, int arg2)
string `*(string arg1, float arg2)
string `*(array(string) arg1, string arg2)
array `*(array(array) arg1, array arg2)
float `*(float arg1, int|float arg2)
float `*(int arg1, float arg2)
int `*(int arg1, int arg2)
mixed `*(mixed arg1, mixed arg2, mixed ... extras)

Description

Multiplication operator.

Returns

If there's only a single argument, that argument will be returned.

If the first argument is an object that implements lfun::`*(), that function will be called with the rest of the arguments.

If there are more than two arguments, the result will be

`*(`*(arg1, arg2), @extras)
.

If arg2 is an object that implements lfun::``*(), that function will be called with arg1 as the single argument.

Otherwise the result will be as follows:

arg1 can have any of the following types:
arrayarg2 can have any of the following types:
int

The result will be arg1 concatenated arg2 times.

string

The result will be the elements of arg1 concatenated with arg2 interspersed.


string

The result will be arg1 concatenated arg2 times.

int

The result will be

arg1 * arg2
, and will be a float if either arg1 or arg2 is a float.


Note

In Pike 7.0 and earlier the multiplication order was unspecified.

See also

`+, `-, [`/()], lfun::`*(), lfun::``*()