[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Questions on data transfer and non-arithmetic handling rules



to the list (and Chuck who already knows this),

  As one of (if not the only one) from the COBOL group who is in the "others differ " group,, I read the initial "scope" and "purpose" clauses of 754 to  mean that this Standard is intended for "arithmetic" and the primary purpose of the "conversion"  sections is for converting from one numeric format to another when used in/for arithmetic statements, operations, or functions (and for comparisons involving numbers in an arithmetic context).

 

The title of the Standard,

  "IEEE Standard for Floating-Point Arithmetic"

 

is something that I have always believed means what it says and says what it means, i.e. that this standard deals with the handling of data items (as we call them in COBOL) that are defined as one of the formats in this Standard WHEN it is used in or for arithmetic.  If a programming language support NON arithmetic functionality for numeric items, then this is NOT the Standard that says how to do this.  Obviously, in many (probably most) cases where there are "similar" functions for the same types of data items one of which is arithmetic and one that is not, there is nothing in 754 that says that they cannot (much less should not) get the same results.  It is just that (as I understand it) this Standard says NOTHING about the handling of such items outside of arithmetic contexts.

 

From: stds-754@xxxxxxxx [mailto:stds-754@xxxxxxxx] On Behalf Of Charles Stevens
Sent: Saturday, April 30, 2011 3:27 PM
To: IEEE 754
Subject: Questions on data transfer and non-arithmetic handling rules

 

1)  I do not find any rule offhand in IEEE Std 754-2008 Clause 5.4.2 or elsewhere that says what happens when the "source" item is exactly the same format (and encoding) as the "sink" item.  My personal assumption is that this would be a "bit-for-bit" transfer, with no reformatting at all, and that's what the COBOL rules specify.  
 
QUESTION:  Is there a rule that specifies this? 
 
2a)  COBOL has two ways of handling data transfer.  One of these is under arithmetic (e.g., COMPUTE B = A), the other is MOVE (MOVE A TO B).  The results are most often the same, but edge-case handling differs.  This leads to: 
 
2b)  I note that 3.1.2, Conformance, requires that a conforming (platform) implementation provides everything in Clause 5, Operations.  I note also that 5.4.2, Conversion operations for floating-point formats and decimal character sequences, is a subclause under 5,4, formatOf geneal-computational operations, but is NOT a subclause of 5.4.1, Arithmetic operations, but falls under a more "universal" classification that also applies elsewhere if full conformance is to be achieved. 
 
QUESTION:  For full conformance to IEEE Std 754-2008, should the provisions of 5.4.2 and 5.5 be taken to apply "universally", even in cases in which arithmetic is not involved, in which case any other behavior or results would be considered "nonconforming", as is indicated by their placement, or is an environment that specifies behavior different from these rules for the same operands for non-arithmetic manipulation nevertheless "conforming"?    My opinion is the former, others differ.   
 
    -Chuck Stevens


754 | revision | FAQ | references | list archive