Double Values
In case both the attribute and the attribute implementation have primitive data type ‘double’ no conversion is needed. However, double values are discussed here because they can have multiple formats.
The following specifies which values are accepted as input:
- <validDouble> ::= [whiteSpace]<significand>[<exponent>][whiteSpace]
- <significand> ::= [<sign>]<unsignedSignificand>
- <unsignedSignificand> ::= <number> | “.”<number> | <number>“.”<number>
- <exponent> ::= “e”|“E” [<sign>]<number>
- <sign> ::= “+”|“-”
- <number> ::= <digit> | <digit><number>
- <digit> ::= “0”|“1”|“2”|“3”|“4”|“5”|“6”|“7”|“8”|“9”
- <whiteSpace> ::= “ ” | “ ”<whiteSpace>
As specified earlier, leading and trailing spaces are accepted. Spaces inside significand or exponent or between significand and exponent are not allowed.
Examples of valid doubles:
"12", "12.3", "0.3", ".3", "+12", "+12.3", "+.3", "-12", "-12.3", "-.3", "012", "012.0".
Each of these can be followed by an exponent. So other valid doubles are for example:
"12.3e1", ".3E2", "+12.3e+12", ".3e-12", "-12E+12", "1E-12".
Examples of invalid doubles:
"12,3", "1,000", "1.000,25", "100e", "12.", ".", "e3", "12 e3" (contains a space), "12e0.5"