* [gentoo-commits] gentoo-x86 commit in dev-ruby/narray/files: narray-0.6.0.8-fix-tests.patch
@ 2013-07-25 14:43 Manuel Rueger (mrueg)
0 siblings, 0 replies; only message in thread
From: Manuel Rueger (mrueg) @ 2013-07-25 14:43 UTC (permalink / raw
To: gentoo-commits
mrueg 13/07/25 14:43:50
Added: narray-0.6.0.8-fix-tests.patch
Log:
Version bump
(Portage version: 2.1.12.13/cvs/Linux x86_64, signed Manifest commit with key )
Revision Changes Path
1.1 dev-ruby/narray/files/narray-0.6.0.8-fix-tests.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-ruby/narray/files/narray-0.6.0.8-fix-tests.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-ruby/narray/files/narray-0.6.0.8-fix-tests.patch?rev=1.1&content-type=text/plain
Index: narray-0.6.0.8-fix-tests.patch
===================================================================
From c56dc59527f0681dae7175b2fcab1fe534444f52 Mon Sep 17 00:00:00 2001
From: Masahiro TANAKA <masa16.tanaka@gmail.com>
Date: Thu, 9 May 2013 16:47:50 +0900
Subject: [PATCH] fix tests for change in Complex class
---
test/testcomplex.rb | 4 ++--
test/testmath.rb | 8 ++++----
test/testpow.rb | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/test/testcomplex.rb b/test/testcomplex.rb
index 7be2e18..8a6346d 100644
--- a/test/testcomplex.rb
+++ b/test/testcomplex.rb
@@ -10,8 +10,8 @@ def testop(a,b)
print "a**b = "; p a**b
end
-a = NArray.complex(4,1).indgen!.sbt!(-1) + 0.25.im
-b = NArray.complex(1,3).indgen!.add!(-0.5).mul!(0.5.im)
+a = NArray.complex(4,1).indgen!.sbt!(-1) + Complex(0,0.25)
+b = NArray.complex(1,3).indgen!.add!(-0.5).mul!(Complex(0,0.5))
testop(a,b)
# compare a/b with real-number operation
diff --git a/test/testmath.rb b/test/testmath.rb
index 0bf70d3..0aaf089 100644
--- a/test/testmath.rb
+++ b/test/testmath.rb
@@ -4,10 +4,10 @@
def pr x
x.each{|i|
if i.kind_of?(Complex)
- printf("%.3f%+.3fi ",i.real,i.image)
+ printf("%.3f%+.3fi ",i.real,i.imag)
else
printf("%.3f ",i)
- end
+ end
}
print "\n"
end
@@ -44,5 +44,5 @@ def testmath(x)
testmath NArray.sfloat(6).indgen.div!(2)
testmath NArray.float(6).indgen.div!(2)
-testmath NArray.scomplex(6).indgen.div!(2)-2 - 1.im
-testmath NArray.complex(6).indgen!/5-0.5# - 0.3.im
+testmath NArray.scomplex(6).indgen.div!(2)-2 - Complex(0,1)
+testmath NArray.complex(6).indgen!/5-0.5# - Complex(0,0.3)
diff --git a/test/testpow.rb b/test/testpow.rb
index 17f81d1..e7360e8 100644
--- a/test/testpow.rb
+++ b/test/testpow.rb
@@ -7,8 +7,8 @@ def test a
p a**[[-3],[0],[7]]
puts 'a**[[-3.0],[0],[7.0]] = '
p a**[[-3.0],[0],[7.0]]
- puts 'a**(1+0.im) = '
- p a**(1+0.im)
+ puts 'a**Complex(1,0) = '
+ p a**Complex(1,0)
puts 'a**1.0 = '
p a**1.0
puts
--
1.8.1.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-07-25 14:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-25 14:43 [gentoo-commits] gentoo-x86 commit in dev-ruby/narray/files: narray-0.6.0.8-fix-tests.patch Manuel Rueger (mrueg)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox