# Class: scalarop

Defines operations between scalararrays / values. Operations are performed componentwise per vector. That means output array and input can be same. Scalartypes must match. Vectorsizes must match, except that last operand may have vectorsize of 1, as well. Non-saturated operations may cause 'wrap' values, ie truncation happening post operation. For example a uint8 operation may yield 300 as result, which means 44 (300 mod 256) is written. The saturated operations would clamp to 255 in that case.

## Hierarchy

    o-+ mathlib
      o-+ scalarop

## Methods:

### Method overview:

- add2
- add2sat
- clear0
- copy1
- div2
- div2sat
- lerp3
- lerpinv3
- madd3
- madd3sat
- max2
- min2
- mul2
- mul2sat
- sub2
- sub2sat

add2
  ([scalarop]):() out = arg1 + arg2.
add2sat
  ([scalarop]):() out = saturate(arg1 + arg2).
clear0
  ([scalarop]):() out = 0 (zero)
copy1
  ([scalarop]):() out = arg1.
div2
  ([scalarop]):() out = arg1 / arg2.
div2sat
  ([scalarop]):() out = saturate(arg1 / arg2).
lerp3
  ([scalarop]):() out = lerp(arg1 to arg2 via arg3).
lerpinv3
  ([scalarop]):() out = lerp(arg1 to arg2 via 1-arg3).
madd3
  ([scalarop]):() out = arg1 + (arg2 * arg3).
madd3sat
  ([scalarop]):() out = saturate(arg1 + (arg2 * arg3)).
max2
  ([scalarop]):() out = max(arg1,arg2).
min2
  ([scalarop]):() out = min(arg1,arg2).
mul2
  ([scalarop]):() out = arg1 * arg2.
mul2sat
  ([scalarop]):() out = saturate(arg1 * arg2).
sub2
  ([scalarop]):() out = arg1 - arg2.
sub2sat
  ([scalarop]):() out = saturate(arg1 - arg2).

## Inherited Methods:

### From mathlib

quatslerpq, quatslerpqt