J3/05-206r1 To: J3 From: Malcolm Cohen Subject: Accuracy of conversion of real literal constants Date: 2005/08/09 NUMBER: F03/0067 TITLE: Accuracy of conversion of real literal constants KEYWORDS: conversion, accuracy DEFECT TYPE: Interpretation STATUS: For consideration QUESTION: The following is independent of IEEE-754. Fortran 2003 10.6.1.2.6 covers conversions between "decimal values" and "internal values" and has some strong requirements. Are there equivalent requirements on accuracy for conversions of real literal constants? Sections 4.1.2 and 4.4.2 seems like the places to find them (if they exist). What rounding mode is used for conversions of real literal constants? Is the same rounding mode used for all such conversions? The following four questions are about positive values, but the same would apply to negative values. Must all "decimal values" in the range smallest non-zero finite internal value (which could be a denormal) to largest finite internal value, e.g. 0.1, be converted? Must all "decimal values" in the range zero to smallest non-zero finite internal value, e.g. 1.0e-999999999, be converted? Must all "decimal values" larger than the largest finite internal value, e.g. 9.9e+99999999999, be converted if infinity is an internal value? What does nearest rounding mean for these cases? What requirements exist for "decimal values" larger than the largest finite internal value if infinity is not an internal value? ANSWER: There are no requirements on accuracy for conversions of real literal constants. The standard does not specify the rounding mode used for conversions of real literal constants, nor does it require the same rounding mode to be used for all conversions. Whether all decimal values in any range can be converted is not standardized. There are no requirements for "decimal values" larger than the largest finite internal value whether infinity is an internal value or not. EDITS: None. SUBMITTED BY: Fred Tydeman HISTORY: J3/05-206 m173 Submitted J3/05-205r1 m173 Draft reply