[#68137] improve semantics of manpages — "Anthony J. Bentley" <anthony@...>
Hi,
1 message
2015/02/17
[#68144] Re: Future of test suites for Ruby — Anthony Crumley <anthony.crumley@...>
FYI...
4 messages
2015/02/17
[#68343] [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault? — ruby@...
Issue #10916 has been reported by why do i need this acct just to create a bug report.
5 messages
2015/02/27
[#68373] Re: [Ruby trunk - Bug #10916] [Open] What the Ruby? SegFault?
— "Martin J. Dürst" <duerst@...>
2015/03/02
> * Author: why do i need this acct just to create a bug report
[#68358] [Ruby trunk - Bug #10902] require("enumerator") scans LOAD_PATH 2x on every invocation — ruby@...1.net
Issue #10902 has been updated by Aman Gupta.
3 messages
2015/02/28
[ruby-core:68069] [Ruby trunk - Bug #10840] [Closed] documentation for Vector#cross_product in module 'matrix' is inconsistent
From:
ruby-core@...
Date:
2015-02-09 02:23:33 UTC
List:
ruby-core #68069
Issue #10840 has been updated by Marc-Andre Lafortune.
Status changed from Open to Closed
The bug was fixed in 2.1.3, so if you are looking at the code in the doc for 2.1.0, you will get the wrong code obviously.
In short, refer to the doc & source for 2.1.3, 2.1.4, 2.1.5 or 2.2.0, like:
http://ruby-doc.org/stdlib-2.1.3/libdoc/matrix/rdoc/Vector.html#method-i-cross_product
http://ruby-doc.org/stdlib-2.2.0/libdoc/matrix/rdoc/Vector.html#method-i-cross_product
----------------------------------------
Bug #10840: documentation for Vector#cross_product in module 'matrix' is inconsistent
https://bugs.ruby-lang.org/issues/10840#change-51453
* Author: Ana Johnson
* Status: Closed
* Priority: Low
* Assignee:
* ruby -v: http://ruby-doc.org/stdlib-2.1.0/
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
the documentation of cross_product is inconsistent. The doc says:
Vector[1, 0, 0].cross_product Vector[0, 1, 0] => Vector[0, 0, 1]
which seems good to me, but the definition given in the "click to toggle source" actually produces: Vector[0,0,-1], which according to a closed bug report seems to be what the function actually once produced. The documented code is still wrong. this would be correct and clear:
def cross_product(v)
Vector.Raise ErrDimensionMismatch unless size == v.size && v.size == 3
Vector[ @elements[1]*v[2] - @elements[2]*v[1],
@elements[2]*v[0] - @elements[0]*v[2],
@elements[0]*v[1] - @elements[1]*v[0] ]
end
I recommend also altering the demonstration code so that a reasonably complete test case is shown:
Vector[1, 0, 0].cross_product Vector[0, 1, 0] => Vector[0, 0, 1]
Vector[0, 1, 0].cross_product Vector[0, 0, 1] => Vector[1, 0, 0]
Vector[0, 0, 1].cross_product Vector[1, 0, 0] => Vector[0, 1, 0]
--
https://bugs.ruby-lang.org/