[Main page] [Overview]     /sefun /partition_array

SYNOPSIS
mixed partition_array( mixed arr, int size)

FILE
/kernel/simul_efun/array.h

DESCRIPTION
Splits an array into an array of sub-arrays with the specified size. If
arr is not a multiple of size, it last sub-array will be filled
up with 0.

EXAMPLES
partition_array( ({ 1, 2, 3, 4, 5, 6 }), 3) will result in
({ ({ 1, 2, 3 }), ({ 4, 5, 6 }) }) be returned
partition_array( ({ 1, 2, 3, 4 }), 3) will result in
({ ({ 1, 2, 3 }), ({ 4, 0, 0 }) }) be returned

SEE ALSO
sefun/split_array