tuple_sgntuple_sgnTupleSgnTupleSgntuple_sgn (Operator)

Name

tuple_sgntuple_sgnTupleSgnTupleSgntuple_sgn — Calculate the sign of a tuple.

Signature

tuple_sgn( : : T : Sgn)

Herror tuple_sgn(double T, Hlong* Sgn)

Herror T_tuple_sgn(const Htuple T, Htuple* Sgn)

void TupleSgn(const HTuple& T, HTuple* Sgn)

HTuple HTuple::TupleSgn() const

static void HOperatorSet.TupleSgn(HTuple t, out HTuple sgn)

HTuple HTuple.TupleSgn()

def tuple_sgn(t: MaybeSequence[Union[float, int]]) -> Sequence[int]

def tuple_sgn_s(t: MaybeSequence[Union[float, int]]) -> int

Description

tuple_sgntuple_sgnTupleSgnTupleSgnTupleSgntuple_sgn calculates the sign of the elements of the input tuple TTTTtt and returns them as integer numbers (-1,0,1) in the output tuple SgnSgnSgnSgnsgnsgn. The calculation of the sign of a string is not allowed.

Exception: Empty input tuple

If the input tuple is empty, the operator returns an empty tuple.

HDevelop In-line Operation

HDevelop provides an in-line operation for tuple_sgntuple_sgnTupleSgnTupleSgnTupleSgntuple_sgn, which can be used in an expression in the following syntax:

Sgn := sgn(T)

Execution Information

Parameters

TTTTtt (input_control)  number(-array) HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Input tuple.

SgnSgnSgnSgnsgnsgn (output_control)  number(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Signs of the input tuple as integer numbers.

Module

Foundation