Issue 1066: Fixed point constant typo in 2.2 (orb_revision) Source: (, ) Nature: Uncategorized Issue Severity: Summary: Summary: Section 3.7.2 of CORBA 2.2 contains an error on page 3-20, last para: For example, 0123.450d is considered to be fixed<5.2> and 3000.00 is fixed<1,-3>. This is in conflict with section 3.2.5 on page 3-9, last para: A fixed-point decimal literal consists of an integer part, a decimal point, a fraction part and d or D. [ ... ] Either the integer part of the fraction part (but not both) may be missing; the decimal point (but not the letter d (or D)) may by missing. So, it seems that the "3000.00" on page 3-20 really should be "3000.00d" or "3000.00D". Resolution: Revised Text: Actions taken: March 18, 1998: received issue February 23, 1999: closed issue Discussion: End of Annotations:===== Return-Path: X-Authentication-Warning: tigger.dstc.edu.au: michi owned process doing -bs Date: Wed, 18 Mar 1998 14:41:38 +1000 (EST) From: Michi Henning To: issues@omg.org Subject: Fixed point constant typo in 2.2 Hi, Section 3.7.2 of CORBA 2.2 contains an error on page 3-20, last para: For example, 0123.450d is considered to be fixed<5.2> and 3000.00 is fixed<1,-3>. This is in conflict with section 3.2.5 on page 3-9, last para: A fixed-point decimal literal consists of an integer part, a decimal point, a fraction part and d or D. [ ... ] Either the integer part of the fraction part (but not both) may be missing; the decimal point (but not the letter d (or D)) may by missing. So, it seems that the "3000.00" on page 3-20 really should be "3000.00d" or "3000.00D". Cheers, Michi. -- Michi Henning +61 7 33654310 DSTC Pty Ltd +61 7 33654311 (fax) University of Qld 4072 michi@dstc.edu.au AUSTRALIA http://www.dstc.edu.au/BDU/staff/michi-henning.html Return-Path: Date: Sun, 12 Jul 1998 14:45:04 -0700 From: jon@floorboard.com (Jon Biggar) To: orb_revision@omg.org Subject: Fixed point type overhall proposal Since I only got comments from Michi (and a lot of comments at that), I've gone ahead and written up a proposal for consideration. [This proposal covers issues #754, #1066, #1068, #1071.] Proposal for overhauling the IDL Fixed Point Type Definition: Part 1: Fix the grammar to prohibit anonymous fixed point parameter declarations [Resolves 754] Change Production 80 to remove as a valid parameter type: ::= | | | | Also add the missing production on page 3-19: ::= "fixed" Rational: Leaving this in causes problems with the C++ binding in the same way that the grammar from CORBA 1.1 and earlier had problems with sequences and arrays as parameters. This is also likely to cause problems with the Ada binding, since each fixed point declaration is mapped to a distinct Ada type. Part 2: Fix the grammar for fixed point constants [Resolves #1066] Change the first paragraph of section 3.7.2 to read: The in the production must be a previously defined name of an , , , , , , or constant. Also, change the "3000.00" in the example of fixed point digits and scale to "3000.00D". Rational: Fixed point constants are defined using the syntax "fixed", not "fixed", while fixed point types are defined using the later syntax. So there is no way for a to refer to a . Part 3: Modify the paragraph at the top of 3-21 to read: A quotient may have an arbitrary number of decimal places, denoted by a scale of s inf . The computation proceeds pairwise, with the usual rules for left-to-right association, operator precedence, and parentheses. All intermediate computations should be performed using double precision (i.e. 62 digit) arithmetic. If an individual computation between a pair of fixed-point literals actually generates more than 31 significant digits, then a 31-digit result is retained as follows: Rational: This change is to make sure that all IDL compilers calculate the results of fixed-point constants the same way, so as not to break interoperability. Part 4: Reword the description of Fixed Type in section 3.8.3 to be: The fixed data type represents a fixed-point decimal number of up to 31 significant digits. The scale factor is a non-negative integer less than or equal to the total number of digits (note that constants with effectively negative scale, such as 10000, are always permitted). The fixed data type will be mapped to the native fixed point capability of a programming language, if available. If there is not a native fixed point type, then the IDL mapping for that language will a fixed point data type. Applications that use the IDL fixed point type across multiple programming languages must take in to account differences between the languages in handling rounding, overflow, and arithmetic precision. Rational: If these values of scale are not universally supported by language bindings, then they are not portable, and so should not be supported by IDL. The Smalltalk, Ada, Cobol and Java languages already contain a native fixed point facility. To define a separate IDL fixed point capability for these languages would be redundant and interfere with integrating legacy code. Part 5: Close Issue 1068 and 1071 without change Rational: The text is quite clear about the mechanism for assigning digits and scale to fixed point constants. This part of the text only addresses how the IDL compiler evaluates arithmetic expressions involving fixed point literals at compile time and is not intended to define how fixed point arithmetic works in various programming languages at run time.