[#290] — Florian Frank <flori@...>
Hi all,
5 messages
2002/08/03
[#297] GC longjmp macros — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/05
[#308] Q: OSSL in std. distr? — Michal Rokos <m.rokos@...>
Hi,
4 messages
2002/08/08
[#326] Implications of a #force_free method in Object? — Matthew Bloch <mattbee@...>
Hello;
8 messages
2002/08/19
[#328] Int vs Long — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/21
[#337] Int vs Long (2nd part) — Michal Rokos <m.rokos@...>
Hi,
7 messages
2002/08/22
[#340] Int vs Long #3 — Michal Rokos <m.rokos@...>
Hi,
9 messages
2002/08/22
[#344] Re: [Cleanup] Int vs Long #3
— nobu.nokada@...
2002/08/22
Hi,
[#348] Re: [Cleanup] Int vs Long #3
— Michal Rokos <m.rokos@...>
2002/08/23
Hello,
[#353] File (struct stat handling) — Michal Rokos <m.rokos@...>
Hello,
6 messages
2002/08/23
[#358] node.h for eval.c — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/23
[#372] rb_class_path — Michal Rokos <m.rokos@...>
Hello,
7 messages
2002/08/27
[#382] Port match to new dup, clone framework — Michal Rokos <m.rokos@...>
Hi,
5 messages
2002/08/28
[#393] in dln.c — Michal Rokos <m.rokos@...>
Hi,
14 messages
2002/08/30
[#398] Re: [MemLeak] in dln.c
— nobu.nokada@...
2002/08/31
Hi,
[#403] Re: [MemLeak] in dln.c
— Michal Rokos <m.rokos@...>
2002/09/02
Hello,
Is there a bug in Matrix or Complex?
From:
Jim Freeze <jim@...>
Date:
2002-08-05 16:53:09 UTC
List:
ruby-core #298
Hi: I found what I would call strange behavior with Matrix and Complex. -> cat c.rb require 'matrix' require 'complex' c1 = Complex.new(1,2) c2 = Complex.new(3,4) c3 = Complex.new(4,2) m = Matrix[[c1,c2],[c3,c2]] puts "m", m m = m.to_f puts "m.to_f", m puts "m.inv.inv", m.inv.inv puts "m.inv.inv.to_f", m.inv.inv.to_f puts (m == m.inv.inv.to_f) -> ruby c.rb m Matrix[[1+2i, 3+4i], [4+2i, 3+4i]] m.to_f Matrix[[1.0+2.0i, 3.0+4.0i], [4.0+2.0i, 3.0+4.0i]] m.inv.inv Matrix[[1.0+2i, 3.0+4i], [4.0+2i, 3+4i]] m.inv.inv.to_f Matrix[[1.0+2i, 3.0+4i], [4.0+2i, 3+4i]] false Why does taking the double inverse let the elements go back to integers? And, why does #to_f not convert each element to a float after taking the inverse? Thanks -- Jim Freeze If only I had something clever to say for my comment... ~