Treatment signum

std/ops/num::signum


Generics

◻ N: Signed

Inputs

⇥ value: Stream<N>

Outputs

↦ sign: Stream<N>


Gives numeric sign of a stream.

  • 0 if number is 0,
  • -1 if number is negative,
  • 1 if number is positive.

ℹ️ For floating types (f32 and f64), NaN values gives NaN output, +INFINITY and +0.0 gives 1, -INFINITY and -0.0 gives -1.