contains

From DavinciWiki
Jump to: navigation, search


64-bit SafeYes

Description

Determing if an array contains a specific value.

Arguments and Return Values

Arguments:A numeric array and a value to search for

Return Value:0 or 1

Usage

Syntax: contains(obj = VAL, value = VAL)

The contains() function determine if an array contains a specific value. The value is converted to the same type as the array, so comparison of an integer array and a floating point number might produce unexpected results.

Contains() returns 1 if the specific value is found in the array, and 0 if it isn't.

Examples

 dv> a
 6x1x1 array of int, bsq format [24 bytes]
 1       2       3       4       5       6

 dv> contains(a,3)
 1

 dv> contains(a,7)
 0

 dv> contains(a,5.6)
 1

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Core Changes

Modified On: 07-06-2009

Personal tools