Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

To support the 'least surprising' approach, groovy literals with decimal points are instantiated as java.math.BigDecimal types rather than binary floating point types (Float, Double). Float and Double types can of course be created explicitly or via the use of a suffix (see table below). Exponential notation is supported for decimal types (BigDecimal, Double Float) with or without a signed
exponent signed exponent (1.23e-23). Hexadecimal and octal literals are also supported. Hexadecimal numbers are specified
in specified in the typical format of "0x" followed by hex digits (e.g. 0x77).

...

Code Block
IntegerLiteral:
	Base10IntegerLiteral
	HexIntegerLiteral
	OctalIntegerLiteral

Base10IntegerLiteral:
	Base10Numeral IntegerTypeSuffix (optional)

HexIntegerLiteral:
	HexNumeral IntegerTypeSuffix (optional)

OctalIntegerLiteral:
	OctalNumeral IntegerTypeSuffix (optional)

IntegerTypeSuffix: one of
	i I l L g G

Base10Numeral:
	0
	NonZeroDigit Digits (optional)

Digits:
	Digit
	Digits Digit

Digit:
	0
	NonZeroDigit

NonZeroDigit: one of
	\1 2 3 4 5 6 7 8 9

HexNumeral:
	0 x HexDigits
	0 X HexDigits

HexDigits:
	HexDigit
	HexDigit HexDigits

HexDigit: one of
	0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F

OctalNumeral:
	0 OctalDigits

OctalDigits:
	OctalDigit
	OctalDigit OctalDigits

OctalDigit: one of
	0 1 2 3 4 5 6 7


DecimalPointLiteral:
	Digits . Digits ExponentPart (optional) DecimalTypeSuffix (optional)
	. Digits ExponentPart (optional) DecimalTypeSuffix (optional)
	Digits ExponentPart DecimalTypeSuffix (optional) 	Digits ExponentPart (optional) DecimalTypeSuffix (optional)

ExponentPart:
	ExponentIndicator SignedInteger

ExponentIndicator: one of
	e E

SignedInteger:
	Signopt Digits

Sign: one of
	+ -

DecimalTypeSuffix: one of
	f F d D g G