Get Sign function#

float uz_signals_get_sign_of_value(float input)#

Outputs 0.0f if input is 0. Outputs 1 if input is positive and -1 if input is negative.

Parameters:
  • input – any input signal

Returns:

float Returns sign for last sample

Example#

Listing 63 Example function call get the sign of the input#
1#include "uz_signals.h"
2int main(void) {
3   float output = uz_signals_get_sign_of_value(20.5f);
4}

Description#

Evaluates the sign of the input value. Returns 0.0f, if the input is 0.0f. Returns 1.0f, if the input is positive and returns -1.0f if the input ist negative.

Figure made with TikZ

Fig. 264 Get_sign function