Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/arm/go/src/cmd/gofmt/testdata/go2numbers.golden

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


package p

const (
	// 0-octals
	_ = 0
	_ = 0123
	_ = 0123456

	_ = 0_123
	_ = 0123_456

	// decimals
	_ = 1
	_ = 1234
	_ = 1234567

	_ = 1_234
	_ = 1_234_567

	// hexadecimals
	_ = 0x0
	_ = 0x1234
	_ = 0xcafef00d

	_ = 0x0
	_ = 0x1234
	_ = 0xCAFEf00d

	_ = 0x_0
	_ = 0x_1234
	_ = 0x_CAFE_f00d

	// octals
	_ = 0o0
	_ = 0o1234
	_ = 0o01234567

	_ = 0o0
	_ = 0o1234
	_ = 0o01234567

	_ = 0o_0
	_ = 0o_1234
	_ = 0o0123_4567

	_ = 0o_0
	_ = 0o_1234
	_ = 0o0123_4567

	// binaries
	_ = 0b0
	_ = 0b1011
	_ = 0b00101101

	_ = 0b0
	_ = 0b1011
	_ = 0b00101101

	_ = 0b_0
	_ = 0b10_11
	_ = 0b_0010_1101

	// decimal floats
	_ = 0.
	_ = 123.
	_ = 0123.

	_ = .0
	_ = .123
	_ = .0123

	_ = 0e0
	_ = 123e+0
	_ = 0123e-1

	_ = 0e-0
	_ = 123e+0
	_ = 0123e123

	_ = 0.e+1
	_ = 123.e-10
	_ = 0123.e123

	_ = .0e-1
	_ = .123e+10
	_ = .0123e123

	_ = 0.0
	_ = 123.123
	_ = 0123.0123

	_ = 0.0e1
	_ = 123.123e-10
	_ = 0123.0123e+456

	_ = 1_2_3.
	_ = 0_123.

	_ = 0_0e0
	_ = 1_2_3e0
	_ = 0_123e0

	_ = 0e-0_0
	_ = 1_2_3e+0
	_ = 0123e1_2_3

	_ = 0.e+1
	_ = 123.e-1_0
	_ = 01_23.e123

	_ = .0e-1
	_ = .123e+10
	_ = .0123e123

	_ = 1_2_3.123
	_ = 0123.01_23

	// hexadecimal floats
	_ = 0x0.p+0
	_ = 0xdeadcafe.p-10
	_ = 0x1234.p123

	_ = 0x.1p-0
	_ = 0x.deadcafep2
	_ = 0x.1234p+10

	_ = 0x0p0
	_ = 0xdeadcafep+1
	_ = 0x1234p-10

	_ = 0x0.0p0
	_ = 0xdead.cafep+1
	_ = 0x12.34p-10

	_ = 0xdead_cafep+1
	_ = 0x_1234p-10

	_ = 0x_dead_cafe.p-10
	_ = 0x12_34.p1_2_3
	_ = 0x1_2_3_4.p-1_2_3

	// imaginaries
	_ = 0i
	_ = 0i
	_ = 8i
	_ = 0i
	_ = 123i
	_ = 123i
	_ = 56789i
	_ = 1234i
	_ = 1234567i

	_ = 0i
	_ = 0i
	_ = 8i
	_ = 0i
	_ = 123i
	_ = 123i
	_ = 56_789i
	_ = 1_234i
	_ = 1_234_567i

	_ = 0.i
	_ = 123.i
	_ = 0123.i
	_ = 000123.i

	_ = 0e0i
	_ = 123e0i
	_ = 0123e0i
	_ = 000123e0i

	_ = 0.e+1i
	_ = 123.e-1_0i
	_ = 01_23.e123i
	_ = 00_01_23.e123i

	_ = 0b1010i
	_ = 0b1010i
	_ = 0o660i
	_ = 0o660i
	_ = 0xabcDEFi
	_ = 0xabcDEFi
	_ = 0xabcDEFp0i
	_ = 0xabcDEFp0i
)

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].