Project

General

Profile

Actions

Feature #13208

closed

Vector.zero(n) and vector.zero?

Added by qitar888 (Chia-sheng Chen) almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Target version:
-
[ruby-core:79503]

Description

Found that I need this recently, and class Matrix has these two function while Vector not.
So I add two function based on Matrix counterpart and also add test.

Usage

require 'matrix'
v = Vector.zero(3)  # => Vector[0, 0, 0]
v.zero?  # => true
w = Vector[1, 0, 0]
w.zero?  # => false

Files

0001-Add-Vector.zero-n-and-vector.zero.patch (2.06 KB) 0001-Add-Vector.zero-n-and-vector.zero.patch qitar888 (Chia-sheng Chen), 02/11/2017 07:54 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0