Site Menu Project Specification Implementation Recommendations Reference Needs Updating Work in Progress Wastebasket Wiki Manual |
Real Number FormattingWiP.RealNumberFormatting HistoryHide minor edits - Show changes to markup 2010-01-14 19:30
by - 2010-01-14 17:53
by -
Added lines 110-117:
Affected Types
2010-01-14 17:50
by -
Added lines 108-109:
whereby 2010-01-14 17:31
by -
Added line 95:
2010-01-14 17:28
by -
Deleted line 73:
Deleted line 96:
Added lines 102-103:
2010-01-14 17:26
by -
Changed lines 101-103 from:
to:
2010-01-14 17:26
by -
Changed lines 75-76 from:
The standard IO library shall provide the following output procedures for every real number type that is provided by the language core or by the standard library. to:
The standard IO library shall provide the following output procedures for every real number type that is provided by the language core or by the standard library. It shall be recommended that user libraries implementing real number types also provide these procedures. Added lines 96-103:
Mapping of WRITE and WRITEF macrosThe compiler shall expand the WRITE and WRITEF macros when invoked with a real number argument as follows:
2010-01-14 17:15
by -
Changed line 75 from:
The following output procedures shall be provided for every real number type, whether pervasive or library supplied. to:
The standard IO library shall provide the following output procedures for every real number type that is provided by the language core or by the standard library. 2010-01-14 17:13
by -
Added lines 74-75:
The following output procedures shall be provided for every real number type, whether pervasive or library supplied. 2010-01-14 17:09
by -
Changed lines 85-86 from:
shall produce output in engineering format with n places before, m places after the decimal point and exponent exp. parameters m and exp shall be rounded to the nearest multiple of three. to:
shall produce output in engineering format with n places before, m places after the decimal point and exponent exp, whereby parameters m and exp shall be rounded to the nearest multiple of three. 2010-01-14 17:08
by -
Added line 86:
parameters m and exp shall be rounded to the nearest multiple of three. 2010-01-14 17:05
by - 2010-01-14 16:58
by -
Changed line 45 from:
( '+' | '-' )? decimalDigit decimalDigit? decimalDigit? ( ',' digitGroup )* to:
( '+' | '-' )? whitespace* decimalDigit decimalDigit? decimalDigit? ( ',' digitGroup )* 2010-01-14 16:54
by -
Changed line 78 from:
to:
Changed line 81 from:
to:
Changed line 84 from:
[@PROCEDURE Write Ledger?( f : File; r : <Real Type?>; i, n : CARDINAL ); to:
Changed line 87 from:
[@PROCEDURE Write Fixed?( f : File; r : <Real Type?>; i, n : CARDINAL ); to:
2010-01-14 16:53
by -
Added lines 73-88:
IO Procedures for Real Number types
[@PROCEDURE Write F?( f : File; r : <Real Type?>; n : CARDINAL ); shall produce output in scientific format with n places after the decimal point. [@PROCEDURE Write Eng?( f : File; r : <Real Type?>; n, m, exp : CARDINAL ); shall produce output in engineering format with n places before, m places after the decimal point and exponent exp. [@PROCEDURE Write Ledger?( f : File; r : <Real Type?>; i, n : CARDINAL ); shall produce output in ledger format with the decimal point at index i and n places after the decimal point. [@PROCEDURE Write Fixed?( f : File; r : <Real Type?>; i, n : CARDINAL ); shall produce output in simple format with the decimal point at index i and n places after the decimal point. 2010-01-14 16:31
by -
Changed lines 18-19 from:
to:
Changed lines 38-39 from:
to:
Changed lines 57-58 from:
to:
Changed line 71 from:
to:
2010-01-14 16:30
by -
Changed lines 15-16 from:
Example: 1.234,567,890+E00 to:
Example: 1.234,567,890E+00 Formatting parameters:
Added lines 37-41:
Formatting parameters:
Added lines 55-58:
Formatting parameters:
Added lines 68-72:
Formatting parameters:
2010-01-14 16:16
by -
Changed lines 32-33 from:
Example: 1,234.456,789E+03 to:
Example: 1,234.567,890E+03 Changed lines 45-55 from:
Example: 1,234,456.00 to:
Examples: 1,234,567.00 or 1,234,567 Simple format, defined by the following EBNF:ledgerReal : ( '+' | '-' )? decimalDigit+ ( '.' decimalDigits+ )? decimalDigit : '0' .. '9' ; Examples: 123456.7890 or 123456 2010-01-14 16:09
by -
Changed line 21 from:
'.' digitGroup ( ',' digitGroup )* engScaleFactor ; to:
'.' digitGroup ( ',' digitGroup )* scaleFactor ; Changed lines 24-25 from:
engScaleFactor : ( '+' | '-' ) digitGroup ; to:
scaleFactor : ( '+' | '-') decimalDigit+ ; Changed lines 30-32 from:
The numeric value of Example: 1,234.456,789E+000 to:
The numeric value of Example: 1,234.456,789E+03 2010-01-14 16:07
by -
Added lines 29-30:
The numeric value of 2010-01-14 16:02
by -
Changed lines 6-8 from:
( '+' | '-' )? decimalDigit '.' decimalDigit+ scaleFactor ; to:
( '+' | '-' )? decimalDigit '.' digitGroup ( ',' digitGroup )* scaleFactor ; digitGroup : decimalDigit decimalDigit decimalDigit ; Changed line 15 from:
Example: 1.23456789+E00 to:
Example: 1.234,567,890+E00 2010-01-14 15:58
by -
Changed line 3 from:
to:
Scientific format, defined by the following EBNF:Changed line 14 from:
to:
Engineering format, defined by the following EBNF:Changed line 28 from:
to:
Ledger format, defined by the following EBNF:2010-01-14 15:58
by -
Added lines 1-38:
There are multiple formats for textual representation of real numbers
sciReal : ( '+' | '-' )? decimalDigit '.' decimalDigit+ scaleFactor ; scaleFactor : ( '+' | '-') decimalDigit+ ; decimalDigit : '0' .. '9' ; Example: 1.23456789+E00
engReal : ( '+' | '-' )? decimalDigit decimalDigit? decimalDigit? ( ',' digitGroup )* '.' digitGroup ( ',' digitGroup )* engScaleFactor ; digitGroup : decimalDigit decimalDigit decimalDigit ; engScaleFactor : ( '+' | '-' ) digitGroup ; decimalDigit : '0' .. '9' ; Example: 1,234.456,789E+000
ledgerReal : ( '+' | '-' )? decimalDigit decimalDigit? decimalDigit? ( ',' digitGroup )* ( '.' decimalDigits+ )? digitGroup : decimalDigit decimalDigit decimalDigit ; decimalDigit : '0' .. '9' ; Example: 1,234,456.00 |