xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/hex.awk (revision e6d6c189fa3a95d7aa27bbe0aeacf7c1a6b57c8c)
1*e6d6c189SCody Peter Mello# Test program from Paul Eggert, eggert@cs.ucla.edu, Jan. 14, 2005
2*e6d6c189SCody Peter Mello
3*e6d6c189SCody Peter MelloBEGIN {
4*e6d6c189SCody Peter Mello	e = "1(e)"
5*e6d6c189SCody Peter Mello	ex = "3e2(ex)"
6*e6d6c189SCody Peter Mello	x = "6e5(x)"
7*e6d6c189SCody Peter Mello
8*e6d6c189SCody Peter Mello	print e+0, x+0
9*e6d6c189SCody Peter Mello	print 0x
10*e6d6c189SCody Peter Mello	print 0e+x
11*e6d6c189SCody Peter Mello	print 0ex
12*e6d6c189SCody Peter Mello	print 010e2
13*e6d6c189SCody Peter Mello	print 0e9.3
14*e6d6c189SCody Peter Mello}
15*e6d6c189SCody Peter Mello
16*e6d6c189SCody Peter Mello# Expected results:
17*e6d6c189SCody Peter Mello# 1 600000
18*e6d6c189SCody Peter Mello# 06e5(x)
19*e6d6c189SCody Peter Mello# 0600001
20*e6d6c189SCody Peter Mello# 03e2(ex)
21*e6d6c189SCody Peter Mello# 1000
22*e6d6c189SCody Peter Mello# 00.3
23