[valarray.comparison] # 29 Numerics library [[numerics]](./#numerics) ## 29.6 Numeric arrays [[numarray]](numarray#valarray.comparison) ### 29.6.3 valarray non-member operations [[valarray.nonmembers]](valarray.nonmembers#valarray.comparison) #### 29.6.3.2 Logical operators [valarray.comparison] [🔗](#lib:operator==,valarray) `template valarray operator==(const valarray&, const valarray&); template valarray operator!=(const valarray&, const valarray&); template valarray operator< (const valarray&, const valarray&); template valarray operator> (const valarray&, const valarray&); template valarray operator<=(const valarray&, const valarray&); template valarray operator>=(const valarray&, const valarray&); template valarray operator&&(const valarray&, const valarray&); template valarray operator||(const valarray&, const valarray&); ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8229) *Mandates*: The indicated operator can be applied to operands of type T and returns a value of type bool or which can be unambiguously implicitly converted to bool[.](#1.sentence-1) [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8235) *Preconditions*: The two array arguments have the same length[.](#2.sentence-1) [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8240) *Returns*: A valarray whose length is equal to the length of the array arguments[.](#3.sentence-1) Each element of the returned array is initialized with the result of applying the indicated operator to the corresponding elements of the argument arrays[.](#3.sentence-2) [🔗](#lib:operator==,valarray_) `template valarray operator==(const valarray&, const typename valarray::value_type&); template valarray operator==(const typename valarray::value_type&, const valarray&); template valarray operator!=(const valarray&, const typename valarray::value_type&); template valarray operator!=(const typename valarray::value_type&, const valarray&); template valarray operator< (const valarray&, const typename valarray::value_type&); template valarray operator< (const typename valarray::value_type&, const valarray&); template valarray operator> (const valarray&, const typename valarray::value_type&); template valarray operator> (const typename valarray::value_type&, const valarray&); template valarray operator<=(const valarray&, const typename valarray::value_type&); template valarray operator<=(const typename valarray::value_type&, const valarray&); template valarray operator>=(const valarray&, const typename valarray::value_type&); template valarray operator>=(const typename valarray::value_type&, const valarray&); template valarray operator&&(const valarray&, const typename valarray::value_type&); template valarray operator&&(const typename valarray::value_type&, const valarray&); template valarray operator||(const valarray&, const typename valarray::value_type&); template valarray operator||(const typename valarray::value_type&, const valarray&); ` [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8293) *Mandates*: The indicated operator can be applied to operands of type T and returns a value of type bool or which can be unambiguously implicitly converted to bool[.](#4.sentence-1) [5](#5) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L8299) *Returns*: A valarray whose length is equal to the length of the array argument[.](#5.sentence-1) Each element of the returned array is initialized with the result of applying the indicated operator to the corresponding element of the array and the non-array argument[.](#5.sentence-2)