NumEx v0.1.0 Logic View Source

A module to perform Logical operations on enumerables

Link to this section Summary

Functions

Takes two arrays and performs logical and operation for the corresponding elements in each array

Takes an array and performs logical not operation on every induvidual element present in it

Takes two arrays and performs logical or operation for the corresponding elements in each array

Takes two arrays and performs logical xor operation for the corresponding elements in each array

Link to this section Functions

Link to this function logical_and(arr1, arr2) View Source
logical_and([number()], [number()]) :: [number()]

Takes two arrays and performs logical and operation for the corresponding elements in each array

Examples

iex> Logic.logical_or([false, false, true, true],[false, true, false, true])
[false, true, true, true]
iex> Logic.logical_or([-1, 1, 2, 10],[0, 1, 0, 4])
[-1, 1, 2, 10]
Link to this function logical_not(arr) View Source
logical_not([boolean()]) :: [boolean()]

Takes an array and performs logical not operation on every induvidual element present in it

Examples

iex> Logic.logical_not([true, false])
[false, true]
Link to this function logical_or(arr1, arr2) View Source
logical_or([number()], [number()]) :: [number()]

Takes two arrays and performs logical or operation for the corresponding elements in each array

Examples

iex> Logic.logical_and([false, false, true, true],[false, true, false, true])
[false, false, false, true]
iex> Logic.logical_and([-1, 1, 2, 10],[0, 1, 0, 4])
[0, 1, 0, 4]
Link to this function logical_xor(arr1, arr2) View Source
logical_xor([boolean()], [boolean()]) :: [boolean()]

Takes two arrays and performs logical xor operation for the corresponding elements in each array

Examples

iex> Logic.logical_xor([false, false, true, true],[false, true, false, true])
[false, true, true, false]