Go to: Synopsis. Return value. MEL examples.

Synopsis

int floatArrayCount(float $item, float[] $list)

Return the number of times the float in $item occurs in the float array $list. Zero is returned if the float is not in the list.

Return value

None

Arguments

Variable Name Variable Type Description
$itemfloatThe float item to search for in the float array.
$listfloat[]A list of float values.

MEL examples

  float $list[] = { 1.0, 2.5, 3.0, 2.5, 2.5 };
  // Result: 1 2.5 3 2.5 2.5 // 
  int $count = floatArrayCount( 1.0, $list );
  // Result: 1 //
  $count = floatArrayCount( 2.5, $list );
  // Result: 3 //
  $count = floatArrayCount( 4.0, $list );
  // Result: 0 //