File: testwhere.rb

package info (click to toggle)
ruby-narray 0.6.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 468 kB
  • sloc: ansic: 4,498; ruby: 1,329; python: 91; makefile: 7
file content (27 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require 'narray'

a = NArray.float(8).indgen!

print "a = "
p a

t,f = ( (a>=5).or(a<2) ).where2
print "t,f = ( (a>=5).or (a<2) ).where2\n"
print "t = "; p t
print "f = "; p f

t,f = ( (a>=5).and(a<2) ).where2
print "t,f = ( (a>=5).and (a<2) ).where2\n"
print "t = "; p t
print "f = "; p f

print "\n vvv no-meaning !! vvv\n"
t,f = ( (a>=5) && (a<2) ).where2
print "t,f = ( (a>=5) && (a<2) ).where2\n"
print "t = "; p t
print "f = "; p f

t,f = ( (a>=5) || (a<2) ).where2
print "t,f = ( (a>=5) || (a<2) ).where2\n"
print "t = "; p t
print "f = "; p f