File: tes_oo.kbs

package info (click to toggle)
basic256 0.9.6.69a-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 26,304 kB
  • sloc: cpp: 7,778; yacc: 926; lex: 575; sh: 21; makefile: 7
file content (15 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# test_oo.kbs - order of operations
# 2008-09-06 jmr
# some samples from
# http://en.wikipedia.org/wiki/Order_of_operations
#
print "(4+10/2)/9 = 1 -- " + ((4+10/2)/9)
print "2 ^ (3 ^ 2) = 512 -- " + (2 ^ (3 ^ 2))
print "1+2*3 = 7 -- " + (1+2*3)
print "3 * 1 / 2 = 1.5 -- " + (3 * 1 / 2)
print "3 * 1 % 2 = 1 -- " + (3 * 1 % 2)
print "1 / 2 * 3 = 1.5 -- " + (1 / 2 * 3)
print "1 % 2 * 3 = 3 -- " + (1 % 2 * 3)
print "3 % 2 * 5 = 5 -- " + (3 % 2 * 5)
print "3 + 1 % 2 = 4 -- " + (3 + 1 % 2)
print "3 % 2 + 5 = 6 -- " + (3 % 2 + 5)