Skip to content

tuple_sgnTupleSgnTupleSgntuple_sgntuple_sgn🔗

Short description🔗

tuple_sgnTupleSgnTupleSgntuple_sgntuple_sgn — Calculate the sign of a tuple.

Signature🔗

tuple_sgn( number T, out number Sgn )void TupleSgn( const HTuple& T, HTuple* Sgn )static void HOperatorSet.TupleSgn( HTuple t, out HTuple sgn )def tuple_sgn( t: MaybeSequence[Union[float, int]] ) -> Sequence[int]

def tuple_sgn_s( t: MaybeSequence[Union[float, int]] ) -> intHerror tuple_sgn( double T, Hlong* Sgn )

Herror T_tuple_sgn( const Htuple T, Htuple* Sgn )

HTuple HTuple::TupleSgn( ) const

HTuple HTuple.TupleSgn( )

Description🔗

tuple_sgnTupleSgn calculates the sign of the elements of the input tuple Ttt and returns them as integer numbers (-1,0,1) in the output tuple Sgnsgnsgn. 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_sgnTupleSgn, which can be used in an expression in the following syntax:

Sgn := sgn(T)

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Ttt (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Input tuple.

Sgnsgnsgn (output_control) number(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Signs of the input tuple as integer numbers.

Module🔗

Foundation