 # Precisely-represented Integers not differentiated from Imprecise Integers

XMLWordPrintable

#### Details

• Type: Bug
• Status: Closed
• Priority: Major
• Resolution: No Action
• Affects Version/s: ODF 1.2 Part 2 CD 1
• Fix Version/s: None
• Component/s:
• Labels:
None
• Environment:

This issue applies in all OpenFormula drafts through draft-19.

• Proposal:
Hide

Introduce terminology for differentiating between integers as Number values without a fractional part and Inegers that are also precise for use in integer-based calculations.

In the following text, the use of asterisks around a term indicate the use of Italic type. In addition, italicized variable names are used to signify representations of values, the value represented, and also expression fragments that determine such representations as their results. These usages are confined to cases where there is no risk of confusion.

Replace section 3.10.5 with the following text:

"""
3.10.5 Integer

An Integer value is a Number type value here the representation has no fractional part (i.e., has fractional value 0 in the representation):

• A Number type value, x, has a fractional part in its representation only when the expressions FLOOR(x) and CEIL(x) determine distinct Number type result values.
• A Number type value, "n*, is an Integer value when the expressions FLOOR(n) and CEIL(n) each determine exactly n as their result value.

3.10.5.1 Precise and Strict Integer Values

A Precise Integer value, n, is a Number type value for which

1. n is an Integer value;

2. for np the Number type value determined by expression (n)-1 and for ns the Number type value determined by the expression (n)+1, it is the case that the represented numerical values satisfy the mathematical condition

np < n < ns.

A Strict Integer value, n, is a Precise Integer value whenever, in addition to the condition (2, above), it is also the case that np and ns ar each Precise Integer values and the expressions (np)+1 and (ns)-1 determine exactly n.

No error value is a Precise Integer value.

Note 1. For Precise Integers, it is assured that there are always neighboring lesser and greater values that are Number type values. For Strict Integers, it is assured that there are always neighboring lesser and greater Number type vaues that are Precise Integers.

Note 2. Although condition (2, above) is always satisfied for any Precise Integer, the expression AND((np)<(n);(*n)<(ns)) can determine the same result as FALSE() if n is so large in magnitude that comparison approximation tolerance influences the result. See COMPARISON APPROXIMATION TOLERANCE [TBD].

Note 3. When n is a Precise Integer value, the expressions INT(n), ROUND(n), and TRUNC(n) also determine exactly n as their result value.

3.10.5.2 Strict Integer Span

A Strict Integer Span is a range over Number type values,

lower <= n <= upper

where

1. lower and upper are Strict Integer values;

2. every mathematical integer between the values of lower and upper is exactly and distinctly represented by a Strict Integer value; and,

3. the expression ((upper)-(lower))+1 determines the correct Strict Integer result.

Note 1. For a Strict Integer Span, it is assured that the integer predecessor of lower and the integer successor of upper have Precise Integer representations. Conditions such as (lower)-1 < n < (upper)+1 are precisely expressible.

Note 2. The condition (3, above) assures that the integer magnitude of the span from lower to upper inclusive has Strict Integer representation, even when the magnitude value does not occur in the Strict Integer Span itself.

"""

Show
Introduce terminology for differentiating between integers as Number values without a fractional part and Inegers that are also precise for use in integer-based calculations. In the following text, the use of asterisks around a term indicate the use of Italic type. In addition, italicized variable names are used to signify representations of values, the value represented, and also expression fragments that determine such representations as their results. These usages are confined to cases where there is no risk of confusion. Replace section 3.10.5 with the following text: """ 3.10.5 Integer An Integer value is a Number type value here the representation has no fractional part (i.e., has fractional value 0 in the representation): A Number type value, x , has a fractional part in its representation only when the expressions FLOOR( x ) and CEIL( x ) determine distinct Number type result values. A Number type value, "n*, is an Integer value when the expressions FLOOR( n ) and CEIL( n ) each determine exactly n as their result value. 3.10.5.1 Precise and Strict Integer Values A Precise Integer value, n , is a Number type value for which 1. n is an Integer value; 2. for np the Number type value determined by expression ( n )-1 and for ns the Number type value determined by the expression ( n )+1, it is the case that the represented numerical values satisfy the mathematical condition np < n < ns . A Strict Integer value, n , is a Precise Integer value whenever, in addition to the condition (2, above), it is also the case that np and ns ar each Precise Integer values and the expressions ( np )+1 and ( ns )-1 determine exactly n . No error value is a Precise Integer value. Note 1. For Precise Integers, it is assured that there are always neighboring lesser and greater values that are Number type values. For Strict Integers, it is assured that there are always neighboring lesser and greater Number type vaues that are Precise Integers. Note 2. Although condition (2, above) is always satisfied for any Precise Integer, the expression AND(( np )<( n);(*n )<( ns )) can determine the same result as FALSE() if n is so large in magnitude that comparison approximation tolerance influences the result. See COMPARISON APPROXIMATION TOLERANCE [TBD] . Note 3. When n is a Precise Integer value, the expressions INT( n ), ROUND( n ), and TRUNC( n ) also determine exactly n as their result value. 3.10.5.2 Strict Integer Span A Strict Integer Span is a range over Number type values, lower <= n <= upper where 1. lower and upper are Strict Integer values; 2. every mathematical integer between the values of lower and upper is exactly and distinctly represented by a Strict Integer value; and, 3. the expression (( upper )-( lower ))+1 determines the correct Strict Integer result. Note 1. For a Strict Integer Span, it is assured that the integer predecessor of lower and the integer successor of upper have Precise Integer representations. Conditions such as ( lower )-1 < n < ( upper )+1 are precisely expressible. Note 2. The condition (3, above) assures that the integer magnitude of the span from lower to upper inclusive has Strict Integer representation, even when the magnitude value does not occur in the Strict Integer Span itself. """

#### Description

The definition of Integer includes a wide range of values that have no fractional part but that are too large to represent integers precisely, there being gaps and even no non-Integer Number values in their vicinity.

This prevents careful limitation and definition of those functions that require precise integer values to be specified for parameters and to be determined as results. It also leads to ambiguity and situations such as those illustrated in OFFICE-2209, OFFICE-846, and others invovling specific functions that are only meaningful when precise integer values are involved.

#### People

• Assignee: Dennis Hamilton (Inactive)
Reporter: Dennis Hamilton (Inactive)
• Watchers:
0 Start watching this issue

#### Dates

• Created:
Updated:
Resolved: