isClose

isClose for vector.

@safe @nogc nothrow pure
bool
isClose
(
size_t D
E
)
(
auto scope ref const(Vector!(D, E)) a
,
auto scope ref const(Vector!(D, E)) b
)

Parameters

a const(Vector!(D, E))

vector.

b const(Vector!(D, E))

other vector.

Return Value

Type: bool

true if both vector are close.

Examples

immutable v = Vector!3([1, 2, 3]);
assert(v.isClose(Vector!3([1, 2, 3])));
assert(!v.isClose(Vector!3([0.9, 2, 3])));
assert(!v.isClose(Vector!3([1, 1.9, 3])));
assert(!v.isClose(Vector!3([1, 2, 2.9])));

Meta