Information technology — Programming languages — Generic package of primitive functions for Ada

Technologies de l'information — Langages de programmation — Ensemble générique de fonctions primitives pour l'Ada

General Information

Status
Withdrawn
Publication Date
21-Dec-1994
Withdrawal Date
21-Dec-1994
Current Stage
9599 - Withdrawal of International Standard
Completion Date
28-Sep-2000
Ref Project

Relations

Buy Standard

Standard
ISO/IEC 11729:1994 - Information technology -- Programming languages -- Generic package of primitive functions for Ada
English language
19 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)

ISO/IEC
INTERNATIONAL
11729
STANDARD
First edition
1994-l 2-l 5
Information technology - Programming
languages - Generic package of primitive
functions for Ada
- Langages de programmation, leurs
Technologies de /‘information
environnements et interfaces de logiciel de systkme - Ensemble
g&-Grique de fonctions primitives pour /‘Ada
Reference number
lSO/IEC 11729:1994(E)

---------------------- Page: 1 ----------------------
ISO/IEC 11729:1994(E)
Contents Page
iv
Foreword .
V
Introduction .
Scope. . 1
Normative reference . 1
Subprograms provided. . 1
...................................... 2
Instantiations
2
Implementations .
............ 3
Machine numbers and storable machine numbers
............................... 4
Denormalized numbers
........................................ 4
Exceptions
....................... 5
Specifications of the subprograms
9.1 EXPONENT - Exponent of the Canonical Representation
............... 5
of a Floating-Point Machine Number
FRACTION - Signed Mantissa of the Canonical Represen-
9.2
tation of a Floating-Point Machine Number . 5
9.3 DECOMPOSE - Extract the Components of the Canonical
... 6
Representation of a Floating-Point Machine Number.
9.4 COMPOSE - Construct a Floating-Point Machine Number
.. G
from the Components of its Canonical Representation.
SCALE - Increment/Decrement the Exponent of the
9.5
Canonical Representation of a Floating-Point Machine
.................................... 7
Number.
9.6 FLOOR - Greatest Integer Not Greater Than a Floating-
... 7
Point Machine Number, as a Floating-Point Number
@ ISO/IEC 1994
All rights reserved. Unless otherwise specified, no part of this publication may be
electronic or mechanical, including
reproduced or utilized in any form or by any means,
photocopying and microfilm, without permission in writing from the publisher.
ISO/IEC Copyright Office l Case postale 56 l CH-1211 Geneve 20 l Switzerland
Printed in Switzerland
ii

---------------------- Page: 2 ----------------------
ISO/IEC 11729:1994(E)
@ ISO/IEC
Least Integer Not Less Than a Floating-Point
9.7 CEILING-
Machine Number, as a Floating-Point Number . . . . . . . .
ROUND - Integer Nearest to a Floating-Point Machine
9.8
Number, as a Floating-Point Number . . . . . . . . . . . . . . .
9.9 TRUNCATE - Integer Part of a Floating-Point Machine
Number, as a Floating-Point Number . . . . . . . . . . . . . . .
9.10 REMAINDER - Exact Remainder Upon Dividing One
Floating-Point Machine Number by Another. . . . . . . . . .
- Floating-Point Machine Number Next to
9.11 ADJACENT
One Floating-Point Machine Number in the Direction of
8
aSecond . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9.12 SUCCESSOR - Floating-Point Machine Number Next
9
Above a Given Floating-Point Machine Number . . . . . . .
Floating-Point Machine Number Next
9.13 PREDECESSOR -
9
Below a Given Floating-Point Machine Number . . . . . . .
Transfer of Sign from One Floating-Point
9.14 COPY-SIGN -
10
Machine Number to Another . . . . . . . . . . . . . . . . . . . . .
LEADING-PART - Floating-Point Machine Number with
9.15
its Mantissa (in the Canonical Representation) Truncated
to a Given Number of Radix-Digits . . . . . . . . . . . . . . . . 10
Annexes
........
A Adaspecificationfor GENERIC-PRIMITIVE-FUNCTIONS 11
B Rationale . 12
..................... 12
B.l Introduction and motivation.
..................................... 12
B.2 History
................................... 13
B.3 Packaging
...................... 13
B.4 Implementation permissions
Accuracy requirements . 13
B.5
Discussion of individual subprograms . 15
B.6
Relationship to other standards . 18
B.7
Influence on Ada 9X . 18
B.8
Biblionraphv . 19
C
. . .
111

---------------------- Page: 3 ----------------------
IS0 Wi’xmXM(E) @I ISO/IEC
Foreword
IS8 (the International Organization for Standardizatlion) and IEC (time In-
ternational Electrotechnical Commission) form the specialized system for
worldwide standardization. National bodies that are members of IS0 or IEC
participate in the development of International Standards through technical
committees established by the respective organization to deal with particular
fields of technical activity. IS0 and IEC technical committees collaborate
in fields of mutual interest. Other international organizations, governmental
and non-governmental, in liaison with IS0 and IEC, also take part in the
work.
In the field of information technology, ISO and IEC have established a
joint technical committee, ISO/IEC JTC 1. Draft International Standards
adopted by the joint technical committee are circulated to national bodies
for vot,ing. Publication as an Internat~ional St,andard requires approval by at
least 75% of the national bodies casting a vote.
International Standard ISO/IEC 11729 was prepared 1x7 Joint Technical
n ormation technology, Subc&niittee 22, Pro-
Committee ISO/IEC JTC 1, 1 j
grum,ming languages, their environments send system software interfaces.
Annex A forms an ihegral part of tIllis International Standard. Annexes
and C are for information only.
iV

---------------------- Page: 4 ----------------------
@ ISO/IEC ISO/IEC 11729:1994(E)
Introduction
The generic package described here is intended to provide primitive opera-
tions that are required to endow mathematical software, such as implemen-
tations of the elementary functions, with the qualities of accuracy, efficiency
and portability. With this International Standard, such mathematical soft-
ware can achieve all of these qualities simultaneously; without it, one or more
of them typically must be sacrificed.
The generic package specification included in this International Standard is
presented as a compilable Ada specification in annex A with explanatory
text in numbered clauses in the main body of text. The explanatory text is
normative, with the exception of notes.
The word “may” as used in this International Standard consistently means
“is allowed to” (or “are allowed to”). It is used only to express permission,
as in the commonly occurring phrase “an implementation may”; other words
sue i as “can, ” “could” or “might”) are used to express ability, possibility,
( 1
capacity or consequentiality.
In formulas, [vJ and [VI mean the greatest integer less than or equal to z1 and
the least integer greater than or equal to ~1, respectively, and other notations
have their customary meaning.

---------------------- Page: 5 ----------------------
This page intentionally left blank

---------------------- Page: 6 ----------------------
INTERNATIONAL STANDARD @ ISO/IEC ISO/IEC 11729:1994(E)
Information technology -
Programming languages -
Generic package of primitive functions for Ada
1 Scope
This International Standard specifies primitive functions and procedures for manipulating the fraction part and the
exponent part of machine numbers (see clause 6) of the generic floating-point type. Additional functions are provided
for directed rounding to a nearby integer, for computing an exact remainder, for determining the immediate neighbors
of a floating-point machine number, for transferring the sign from one floating-point machine number to another and
for shortening a floating-point machine number to a specified number of leading radix-digits. Some subprograms are
This is intentional so that convenient calls and fast
redundant in that they are combinations of other subprograms.
execution can be provided to the user.
These subprograms are intended to augment standard Ada operations and to be useful in portably implementing
such packages as those providing real and complex elementary functions, where (for example) the steps of argument
reduction and result construction demand fast, error-free scaling and remaindering operations.
This International Standard is applicable to programming environments conforming to IS0 8652:1987.
2 Normative reference
The following standard cant ains provisions which, through reference in this text , constitute provisions of this Interna-
tional Standard. At the time of publication, the edition indicated was valid. All standards are subject to revision, and
parties to agreements based on this International Standard are encouraged to investigate the possibility of applying
Members of IEC and IS0 maint,ain registers of currently
the most recent edit,ion of the standard indicatJed below.
valid International Standards.
IS0 8652:1987, Progrumming languages - Ada (Endorsement of ANSI Standard 1815A-1983)
3 Subprograms provided
The following fifteen subprograms are provided:
EXPONENT FRACTION DECOMPOSE COMPOSE SCALE
CEILING ROUND TRUNCATE REMAINDER
FLOOR
PREDECESSOR
ADJACENT SUCCESSOR
COPY-SIGN LEADING-PART
The EXPONENT and FRACTION functions and the DECOMPOSE procedure decompose a floating-point machine number
into its constituent parts, whereas the COMPOSE function constructs a floating-point machine number from those parts.
The SCALE function scales a float,ing-point machine number accurately by a power of the hardware radix. The FLOOR,
CEILING, ROUND and TRUNCATE functions all yield an integer value (in floating-point format) “near” the given floating-
The REMAINDER function provides an accurate remainder for
point argument, using distinct methods of rounding.
The ADJACENT,SUCCESSOR and PREDECESSOR
floating-point operands, using the semantics of the IEEE REM operation.
1

---------------------- Page: 7 ----------------------
@ ISO/IEC
ISO/IEC 11729:1994(E)
functions yield floating-point machine numbers in the immediate vicinity of other floating-point machine numbers.
The COPY-SIGN function transfers the sign of one floating-point machine number to another. The LEADING-PART
function retains only the specified number of high-order radix-digits of a floating-point number, effectively replacing
the remaining (low-order) radix-digits by zeros.
4 Instantiations
This International Standard describes a generic package, GENERIC-PRIMITIVE-FUNCTIONS, which the user must in-
FLOAT-TYPE and
stantiate to obtain a package. It has two generic formal parameters: a generic formal type named
a generic formal type named EXPONENT-TYPE. At instantiation, the user must specify a floating-point subtype as the
generic actual parameter to be associated with FLOAT-TYPE and an integer subtype as the generic actual parameter to
be associated with EXPONENT-TYPE. These are referred to below as the “generic actual types.” These types are used
as the parameter and, where applicable, the result types of the subprograms contained in the generic package.
Depending on the implementation, the user may or may not be allowed to associate, with FLOAT-TYPE, a generic actual
type having a range constraint (see clause 5). If allowed, such a range constraint will have the usual effect of causing
CONSTRAINT-ERROR to be raised when a floating-point argument outside the user’s range is passed in a call to one
of the subprograms, or when one of the subprograms attempts to return a floating-point value (either as a function
Allowing the generic actual type associated
result or as a formal parameter of mode out) outside the user’s range.
with FLOAT-TYPE to have a range constraint also has some implications for implementors.
The user is allowed to associate any integer-type generic actual type with EXPONENT-TYPE. However, insufficient range
in the generic actual type will have the usual effect of causing CONSTRAINT-ERROR to be raised when an integer-type
or when one of the subprograms
argument outside the user’s range is passed in a call to one of the subprograms,
attempts to return an integer-type value (either as a function result or as a formal parameter of mode out) outside
the user’s range. Further considerations are discussed in clause 5.
In addition to the body of the generic package itself, implementors may provide (non-generic) library packages that
can be used just like instantiations of the generic package for the predefined floating-point types (in combination
with INTEGER for EXPONENT-TYPE). Tl re name of a package serving as a replacement for an instantiation of GENER-
IC-PRIMITIVE-FUNCTIONS in which FLOAT-TYPE is equated with FLOAT (and EXPONENT-TYPE with INTEGER) should
be PRIMITIVE-FUNCTIONS; for LONG-FLOAT and SHORT-FLOAT, the names should be LONG~PRIMITIVE~FUNCTIONS and
SHORT,PRIMITIVE,FUNCTIONS, respectively; etc. Mhen such a package is used in an application in lieu of an instan-
tiation of GENERIC-PRIMITIVE-FUNCTIONS, it shall have the semantics implied by this International Standard for an
instantiation of the generic package. This International Standard does not prescribe names for implementor-supplied
non-generic library packages serving as pre-instantiations of GENERIC-PRIMITIVE-FUNCTIONS for exponent types other
than INTEGER.
5 Implementations
For the most part, the results specified for the subprograms in clause 9 do not permit the kinds of approximations
allowed by Ada’s model of floating-point arithmetic. For this reason, portable illlplelllelltatiolls of the body of GENER-
IC-PRIMITIVE-FUNCTIONS are not believed to be possible. An implementation of this International Standard in Ada
machine-code insertions, representation clauses
may use pragma INTERFACE or other pragmas, unchecked conversion,
or other machine-dependent techniques as desired.
An implementor is assumed to have knowledge of the underlying hardware environment and is expected to utilize
that knowledge to produce the exact results (or, in a few cases, highly constrained approximat)ions) specified by this
International Standard; for example, implementations may directly manipulate the exponent field and fraction field
of floating-point numbers.
An implementation may impose a restriction that the generic actual t,ype associated with FLOAT-TYPE shall not have
If it does impose this restriction, then the restriction
a range constraint that reduces the range of allowable values.
shall be documented, and the effects of violating the restriction shall be one of the following:
2

---------------------- Page: 8 ----------------------
@ ISO/IEC ISO/IEC 11729:1994(E)
- Compilation of a unit containing an instantiation of GENERIC-PRIMITIVE-FUNCTIONS is rejected.
- CONSTRAINT-ERROR or PROGRAM-ERROR is raised during the elaboration of an instantiation of GENERIC-PRIMI-
TIVE-FUNCTIONS.
Conversely, if an implen~entation does not impose the restriction, then such a range constraint shall not be allowed,
when included with the user’s generic actual type, to interfere with the internal computations of the subprograms;
that is, if the floating-point argument and result are within the range of the type, then the implementation shall return
the result and shall not raise an exception (such as CONSTRAINT-ERROR).
An implementation shall not allow insufficient range in the user’s generic actual type associated with EXPONENT-TYPE to
interfere with the internal computations of a subprogram when the range is sufficient to accommodate the integer-type
arguments and integer-type results of the subprogram.
An implementation shall function properly in a tasking environment. Apart from the obvious restriction that an
implementation of GENERIC-PRIMITIVE-FUNCTIONS shall avoid declaring variables that are global to the subprograms,
no special constraints are imposed on implen~entations. Nothing in this International Standard requires the use of
such global variables.
Some hardware and their accompanying Ada implementations have the capability of representing and discriminating
between positively and negatively signed zeros as a means (for example) of preserving the sign of an infinitesimal quan-
tity that has underflowed to zero. Implementations of GENERIC-PRIMITIVE-FUNCTIONS may exploit that capability,
when available, in appropriate ways. At the same time, in~plen~entations in which that capability is unavailable are
also allowed. Because a definition of what comprises the capability of representing and distinguishing signed zeros is
beyond the scope of this International Standard, implementations are allowed the freedom not to exploit the capability,
even when it is available. This International Standard leaves unspecified in some cases the sign that an implementation
exploiting signed zeros shall give to a zero result; it does, however,
specify that an implementation exploiting signed
zeros shall yield a result for COPY-SIGN that depends on the sign of a zero argument.
An implementation shall exercise
its choice consistently, either exploiting signed-zero behavior everywhere or nowhere in this package. In addition, an
in~plementation shall document its behavior with respect to signed zeros.
NOTE - It is intended that implementations of FLOOR, CEILING, ROUND and TRUNCATE determine the result without an inter-
mediate conversion to an integer type, which might raise an exception.
6 Machine numbers and storable machine numbers
In the broad sense, a floating-point “machine number” of type FLOAT-TYPE is any number that can arise in the course
of computing with operands and operations of that type. The set of such numbers depends on the implementation
of Ada. Some ixllplexllentations hold intermediate results in extended registers having a longer fraction part and/or
wider exponent range than the storage cells that hold the values of variables. Thus, in the broad sense, there can be
two or more different representations of floating-point machine numbers of type FLOAT-TYPE.
One such representation is that of the set of “storable” floating-point machine numbers. This representation is
assumed to be the one characterized by the representation attributes of FLOAT-TYPE -for example (and in particu-
lar), FLOAT-TYPE'MACHINE,MANTISSA, FLOAT-TYPE'BASE'FIRST and FLOAT-TYPE'BASE'LAST. The significance ofthe
storable floating-point machine numbers is that they can be assumed to be propagated by assignment, parameter asso-
ciation and function returns; because of the limited lifetime of values held in extended registers, there is no guarantee
that a floating-point machine number outside this subset, once generated, can be so propagated.
The machine numbers referred to subsequently in this International Standard are to be understood to be storable floating-
point machine numbers. An ixllplex~lexltatioxl of GENERIC-PRIMITIVE-FUNCTIONS is thus entitled to assume that the
arguments of all of its subprograms are always storable floating-point machine numbers; furthermore, to support
this International Standard, an ixllplexllexltatioxl of Ada shall guarantee that only storable floating-point machine
numbers are received as arguments by these subprograms. Without the assumption and the restriction, the exact
results specified by this International Standard would be unrealistic (because, for example, they would imply that
3

---------------------- Page: 9 ----------------------
ISO/IEC 11729:1994(E) @ ISO/IEC
extra-precise results must be delivered when extra-precise arguments are received), and those specified for ADJACENT,
SUCCESSOR and PREDECESSOR would not even be well-defined.
The storability of a subprogram’s arguments does not always guarantee that the desired mathematical result is repre-
sentable as a storable floating-point machine number. In the few subprograms where the desired mathematical result
can sometimes be unrepresentable, the actual result is permitted to be a specified approximation of the mathematical
result, or it is omitted and replaced by the raising of an exception (see clause 8).
The term “neighboring machine number” is used in two contexts in this International Standard.
- When a desired mathematical result CF is not representable but lies within the range of machine numbers, it
necessarily falls between two adjacent machine numbers, the one immediately above and the one immediately below;
those two numbers are referred to as the “machine numbers neighboring CL”
- Every machine number X except the most positive (FLOAT-TYPE' BASE' LAST) has a nearest neighbor in the
positive direction, and every one except the most negative (FLOAT-TYPE' BASE' FIRST) has a nearest neighbor in the
negative direction; each is referred to as the “machine number neighboring X” in the given direction.
In both cases, the identity of the neighboring machine numbers is uniquely (if here only informally) determined by the
fact that the set of machine numbers is understood to be the set of storable machine numbers (having FLOAT-TYPE I MA-
CHINE-MANTISSA radix-digits in the fractional part of their canonical form) and is totally ordered.
7 Denormalized numbers
On machines fully or partially obeying IEEE arithmetic, the denormalized numbers are included in the set of machine
numbers if the ixllplexllexltatioxl of Ada uses the hardware in such a way that they can arise from normal Ada arithmetic
operations (such implementations are said in this International Standard to “recognize denormalized numbers”);
otherwise, they are not. Whether an implementation recognizes denormalized numbers determines whether the results
of some subprograms, for particular arguments, are exact or approximate; it is also taken into account in determining
the results that can be produced by the ADJACENT, SUCCESSOR and PREDECESSOR functions.
As used in this International Standard, a nonzero quantity Q! is said to be “in the denormalized range” when lcvl <
FLOAT-TYPE ’ MACHINE,RADIX(F~OAT-T~~~‘HAcHINE-ExlN-l);
the term “canonical form of a floating-point number” is taken
from the Ada Reference Manual, but its applicability is here extended to denormalized numbers by allowing the leading
digit of the fractional part to be zero when the exponent part is equal to FLOAT-TYPE' MACHINE-EMIN.
8 Exceptions
Various conditions can make it impossible for a subprogram in GENERIC-PRIMITIVE-FUNCTIONS to deliver a result.
Whenever this occurs, the subprogram raises an exception instead. No exceptions are declared in GENERIC-PRIMI-
TIVE-FUNCTIONS; thus, only predefined exceptions are raised, as described below.
The REMAINDER function performs an operation related to division. When its second argument is zero, it raises the
exception specified by Ada for signaling division by zero (this is NUMERIC-ERROR in the Ada Reference Manual, but it
is changed to CONSTRAINT-ERROR by AI-00387).
The result defined for the SCALE, COMPOSE, SUCCESSOR, PREDECESSOR and, on some hardware, COPY-SIGN functions
can exceed the overflow threshold of the hardware. When this occurs (or, more precisely, when the defined result falls
outside the range FLOAT-TYPE I BASE ' FIRST to FLOAT-TYPE ' BASE I LAST), the function raises the exception specified by
Ada for signaling overflow (this is NUMERIC-ERROR in the Ada Reference Manual, but it is changed to CONSTRAINT-ERROR
by AI-00387).
All of the subprograms, as stated in clause 4, are subject to raising CONSTRAINT-ERROR when an integer-type value
outside the bounds of the user’s generic actual type associated with EXPONENT-TYPE is passed as an argument, or
4

---------------------- Page: 10 ----------------------
@ ISO/IEC ISO/IEC 11729:1994(E)
Similarly, if the implementation allows
when one of the subprograms attempts to return such an integer-type value.
range constraints in the generic actual type associated with FLOAT-TYPE, then CONSTRAINT-ERROR will be raised when
the value of a floating-point argument lies outside the range of that generic actual type, or when a subprogram in
GENERIC,PRIMITIVE,FUNCTIONS attempts to return a value outside that range. Additionally, all of the subprograms
are subject to raising STORAGE-ERROR when they cannot obtain the storage they require.
Whereas a result that is too large to be represented causes the signaling of overflow, a result that is too small to
such a result, which can be computed by SCALE, COMPOSE and
be represented exactly does not raise an exception;
REMAINDER, is instead approximated (possibly by zero), as specified separately for each of these subprograms.
The only exceptions allowed during an instantiation of GENERIC-PRIMITIVE-FUNCTIONS, including the execution
of the optional sequence of statements in the body of the instance, are CONSTRAINT-ERROR, PROGRAM-ERROR and
STORAGE-ERROR, and then only for the reasons given in this paragraph.
The raising of CONSTRAINT-ERROR during
instantiation is only allowed when the illlplelllelltatioll imposes the restriction that the generic actual type associ-
ated with FLOAT-TYPE shall not have a range constraint, and the user violates that restriction (it can, in fact, be
an inescapable consequence of the violation). The raising of PROGRAM-ERROR during instantiation is only allowed for
the purpose of signaling errors made by the -for example, violation of this same restriction. The raising of
user
STORAGE-ERROR during instantiation is only allowed for the purpose of signaling the exhaustion of storage.
9 Specifications of the subprograms
Except where an approximation is explicitly allowed and defined, the formulas given below under the heading Definition
specify precise mathematical results. In a few cases, these formulas leave a subprogram undefined for certain arguments;
in those cases, the subprogram will raise an exception, as stated under the heading Exceptions, instead of delivering
a result.
In the specificationsof EXPONENT, FRACTION, DECOMPOSE, COMPOSE, SCALE and LEADING-PART, the symbolP stands for
the value of FLOAT-TYPE'MACHINE-RADIX.
Exponent of the Canonical Representation of a Floating-Point Machine Num-
9.1 EXPONENT -
ber
9.1.1 Specification
function EXPONENT (X : FLOAT-TYPE) return EXPONENT-TYPE;
9.1.2 Definition
a) EXPONENT(O.0) =O.O
b) For X # 0 .O, EXPONENT(X) yields the unique integer k such that ,@-l 5 1x1 < ,8”
NOTE- When X is a denorlnalized nunrber, EXPONENT(X) < FLOAT-TYPE'MACHINE-EMIN.
Signed Mantissa of the Canonical Representation of a Floating-Point Machine
9.2 FRACTION -
Number
9.2.1 Specification
function FRACTION (X : FLOAT-TYPE) return FLOAT-TYPE;

---------------------- Page: 11 ----------------------
@ ISO/IEC
ISO/IEC 11729:1994(E)
9.2.2 Definition
a) FRACTION(O.0) =O.O
where I; is the unique integer such that p”-’ < 1x1 < pk
b) For X# O.O,FRACTION(X) =X-Pmk,
9.3 DECOMPOSE - Extract the Components of the Canonical Representation of a Floating-
Point Machine Number
9.3.1 Specification
procedure DECOMPOSE (X : in FLOAT-TYPE;
FRACTION : out FLOAT-TYPE;
EXPONENT : out EXPONENT-TYPE);
9.3.2 Definition
0.0 upon return from an invocation of DECOMPOSE(O.0, FRACTION,
a) FRACTION = 0.0 and EXPONENT =
EXPONENT)
k, where k is the unique integer such that p”-’ < 1x1 < /3’“,
b) For X # O.O,FRACTION = X./?-I; and EXPONENT=
-
upon return from an invocation of DECOMPOSE(X, FRACTION, EXPONENT)
when X is a denormalized number, EXPONENT < FLOAT-TYPE'MACHINE,EMIN upon return from an invocation of
NOTE -
DECOMPOSE(X, FRACTION, EXPONENT).
9.4 COMPOSE - Construct a Floating-Point Machine Number from the Components of its
Canonical Representation
9.4.1 Specification
function COMPOSE (FRACTION : FLOAT-TYPE;
: EXPONENT-TYPE) return FLOAT-TYPE
EXPONENT
9.4.2 Definition
a) COMPOSE(O.0, EXPONENT) = 0.0 for any EXPONENT
where k is the unique integer such that p”-l < 1x1 < pk. If
b) For FRACTION # O.O,let a = FRACTION-@ExPoNENT-k,
a is exactly representable as a floating-point machine number (see clause G), COMPOSE(FRACTION, EXPONENT) = q
otherwise, COMPOSE (FRACTION, EXPONENT) yields either one of the machine numbers neighboring 0, provided that
FLOAT-TYPE’BASE’FIRST < Q < FLOAT-TYPE’BASE’LAST.
9.4.3 Exceptions
When al as defined above is outside the range of machine numbers, COMPOSE raises the exception specified by Ada for
signaling overflow (see clause 8) instead of delivering a result.
NOTES
1 For FRACTION # 0 .O, this function can deliver an approximation (possibly zero) to the exact mathematical result o only
and either the implementation does not
when EXPONENT is sufficiently negative to force cy to be in the denormalized range,
recognize denormalized numbers, or 0 is not esactly representable as a denormalized number (see clause 7).
ument is restri cted to fractional values; rather, it is meant to
2 The name FRACTION is not meant to suggest that the first arg
the canonical form .) the fractional part of the result.
that the first argument suppli .es (via its fractional par t in
suggest

---------------------- Page: 12 ----------------------
ISO/IEC 11729:1994(E)
@ ISO/IEC
9.5 SCALE - Increment/Decrement the Exponent of the Canonical Representation of a
Floating-Point Machine Number
9.5.1 Specification
: FLOAT-TYPE;
function SCALE (X
: EXPONENT-TYPE) return FLOAT-TYPE;
ADJUSTMENT
9.5.2 Definition
Let a = x . pAD3USTHENT.
If QI is exactly representable as a floating-point machine number (see clause 6),
SCALE(X, ADJUSTMENT) = a/; otherwise, SCALE(X, ADJUSTMENT) yields either one of the machine numbers neigh-
boring a, providedthatFLOAT_TYPE'BASE'FIRST < a < FLOAT-TYPE'BASE'LAST.
9.5.3 Exceptions
When o as defined above is outside the range of machine numbers, SCALE raises the exception specified by Ada for
signaling overflow (see clause S), instead of delivering a result.
NOTE- This function can deliver
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.