File: AA-A-5-3.html

package info (click to toggle)
ada-reference-manual 20021112web-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, sarge
  • size: 18,652 kB
  • ctags: 8,921
  • sloc: makefile: 52; sh: 20
file content (636 lines) | stat: -rw-r--r-- 45,601 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
    <TITLE>AARM95 - Attributes of Floating Point Types</TITLE>
    <META NAME="Author" CONTENT="JTC1/SC22/WG9/ARG, by Randall Brukardt, ARG Editor">
    <META NAME="GENERATOR" CONTENT="Arm_Form.Exe, Ada Reference Manual generator">
    <STYLE type="text/css">
    DIV.paranum {position: absolute; font-family: Arial, Helvetica, sans-serif; left: 0.5 em; top: auto}
    TT {font-family: "Courier New", monospace}
    DT {display: compact}
    DIV.Normal {font-family: "Times New Roman", Times, serif; margin-bottom: 0.6em}
    DIV.Wide {font-family: "Times New Roman", Times, serif; margin-top: 0.6em; margin-bottom: 0.6em}
    DIV.Annotations {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-bottom: 0.6em}
    DIV.WideAnnotations {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0.6em; margin-bottom: 0.6em}
    DIV.Index {font-family: "Times New Roman", Times, serif}
    DIV.SyntaxSummary {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.4em}
    DIV.Notes {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.6em}
    DIV.NotesHeader {font-family: "Times New Roman", Times, serif; margin-left: 2.0em}
    DIV.SyntaxIndented {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-bottom: 0.4em}
    DIV.Indented {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-bottom: 0.6em}
    DIV.CodeIndented {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-bottom: 0.6em}
    DIV.SmallIndented {font-family: "Times New Roman", Times, serif; margin-left:  10.0em; margin-bottom: 0.6em}
    DIV.SmallCodeIndented {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-bottom: 0.6em}
    DIV.Examples {font-family: "Courier New", monospace; margin-left: 2.0em; margin-bottom: 0.6em}
    DIV.SmallExamples {font-family: "Courier New", monospace; font-size: 80%; margin-left: 7.5em; margin-bottom: 0.6em}
    DIV.IndentedExamples {font-family: "Courier New", monospace; margin-left: 8.0em; margin-bottom: 0.6em}
    DIV.SmallIndentedExamples {font-family: "Courier New", monospace; font-size: 80%; margin-left:  15.0em; margin-bottom: 0.6em}
    UL.Bulleted {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.SmallBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.NestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.SmallNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.IndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.CodeIndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.CodeIndentedNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-right: 8.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.SyntaxIndentedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.NotesBulleted {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    UL.NotesNestedBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    DL.Hanging {font-family: "Times New Roman", Times, serif; margin-top: 0em; margin-bottom: 0.6em}
    DD.Hanging {margin-left: 6.0em}
    DL.IndentedHanging {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0em; margin-bottom: 0.6em}
    DD.IndentedHanging {margin-left: 2.0em}
    DL.HangingInBulleted {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.HangingInBulleted {margin-left: 4.0em}
    DL.SmallHanging {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-top: 0em; margin-bottom: 0.6em}
    DD.SmallHanging {margin-left: 7.5em}
    DL.SmallIndentedHanging {font-family: "Times New Roman", Times, serif; margin-left: 8.0em; margin-top: 0em; margin-bottom: 0.6em}
    DD.SmallIndentedHanging {margin-left: 2.0em}
    DL.SmallHangingInBulleted {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.SmallHangingInBulleted {margin-left: 5.0em}
    DL.Enumerated {font-family: "Times New Roman", Times, serif; margin-right: 0.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.Enumerated {margin-left: 2.0em}
    DL.SmallEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 4.0em; margin-right: 4.0em; margin-top: 0em; margin-bottom: 0.5em}
    DD.SmallEnumerated {margin-left: 2.5em}
    DL.NestedEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 2.0em; margin-right: 2.0em; margin-top: 0em; margin-bottom: 0.5em}
    DL.SmallNestedEnumerated {font-family: "Times New Roman", Times, serif; margin-left: 6.0em; margin-right: 6.0em; margin-top: 0em; margin-bottom: 0.5em}
    </STYLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFF0" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
<P><A HREF="AA-TOC.html">Contents</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-0-29.html">Index</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-A-5-2.html">Previous</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-A-5-4.html">Next</A></P>
<HR>
<H1> A.5.3 Attributes of Floating Point Types</H1>

<H4 ALIGN=CENTER>Static Semantics</H4>
<DIV Class="Paranum"><FONT SIZE=-2>1</FONT></DIV>
<DIV Class="Normal" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;<A NAME="I5633"></A>The
following <I>representation-oriented attributes</I> are defined for every
subtype S of a floating point type <I>T</I>. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>2</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;S'Machine_Radix<DD Class="Hanging">
<A NAME="I5634"></A><A NAME="I5635"></A>Yields the radix of the hardware
representation of the type <I>T</I>. The value of this attribute is of
the type <I>universal_integer</I>. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>3</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;<A NAME="I5636"></A>The values of other representation-oriented
attributes of a floating point subtype, and of the ``primitive function''
attributes of a floating point subtype described later, are defined in
terms of a particular representation of nonzero values called the <I>canonical
form</I>. The canonical form (for the type <I>T</I>) is the form<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&plusmn; <I>mantissa</I> &middot; <I>T</I>'Machine_Radix<SUP><FONT SIZE=+1><FONT SIZE=-2><I>exponent</I></FONT></FONT></SUP><BR>
where </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>4</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC><I>mantissa</I> is a fraction in the number base <I>T</I>'Machine_Radix,
the first digit of which is nonzero, and</LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>5</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC><I>exponent</I> is an integer. </LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>6</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;S'Machine_Mantissa<DD Class="Hanging">
<A NAME="I5637"></A><A NAME="I5638"></A>Yields the largest value of <I>p</I>
such that every value expressible in the canonical form (for the type
<I>T</I>), having a <I>p</I>-digit <I>mantissa</I> and an <I>exponent</I>
between <I>T</I>'Machine_Emin and <I>T</I>'Machine_Emax, is a machine
number (see <A HREF="AA-3-5-7.html">3.5.7</A>) of the type <I>T</I>.
This attribute yields a value of the type <I>universal_integer</I>. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>6.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>Values of
a type held in an extended register are, in general, not machine numbers
of the type, since they cannot be expressed in the canonical form with
a sufficiently short <I>mantissa</I>. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>7</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;S'Machine_Emin<DD Class="Hanging">
<A NAME="I5639"></A><A NAME="I5640"></A>Yields the smallest (most negative)
value of <I>exponent</I> such that every value expressible in the canonical
form (for the type <I>T</I>), having a <I>mantissa</I> of <I>T</I>'Machine_Mantissa
digits, is a machine number (see <A HREF="AA-3-5-7.html">3.5.7</A>) of
the type <I>T</I>. This attribute yields a value of the type <I>universal_integer</I>.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>8</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;S'Machine_Emax<DD Class="Hanging">
<A NAME="I5641"></A><A NAME="I5642"></A>Yields the largest (most positive)
value of <I>exponent</I> such that every value expressible in the canonical
form (for the type <I>T</I>), having a <I>mantissa</I> of <I>T</I>'Machine_Mantissa
digits, is a machine number (see <A HREF="AA-3-5-7.html">3.5.7</A>) of
the type <I>T</I>. This attribute yields a value of the type <I>universal_integer</I>.
</DL>
<DIV Class="Paranum"><FONT SIZE=-2>8.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>Note that
the above definitions do not determine unique values for the representation-oriented
attributes of floating point types. The implementation may choose any
set of values that collectively satisfies the definitions.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>9</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;S'Denorm<DD Class="Hanging">
<A NAME="I5643"></A><A NAME="I5644"></A>Yields the value True if every
value expressible in the form<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&plusmn; <I>mantissa</I> &middot; <I>T</I>'Machine_Radix<SUP><FONT SIZE=+1><FONT SIZE=-2><I>T</I>'Machine_Emin</FONT></FONT></SUP><BR>
where <I>mantissa</I> is a nonzero <I>T</I>'Machine_Mantissa-digit fraction
in the number base <I>T</I>'Machine_Radix, the first digit of which is
zero, is a machine number (see <A HREF="AA-3-5-7.html">3.5.7</A>) of
the type <I>T</I>; yields the value False otherwise. The value of this
attribute is of the predefined type Boolean. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>10</FONT></DIV>
<DIV Class="Normal">&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I5645"></A>The values described by the
formula in the definition of S'Denorm are called <I>denormalized numbers</I>.
<A NAME="I5646"></A>A nonzero machine number that is not a denormalized
number is a <I>normalized number</I>. <A NAME="I5647"></A><A NAME="I5648"></A>A
normalized number <I>x</I> of a given type <I>T</I> is said to be <I>represented
in canonical form</I> when it is expressed in the canonical form (for
the type <I>T</I>) with a <I>mantissa</I> having <I>T</I>'Machine_Mantissa
digits; the resulting form is the <I>canonical-form representation</I>
of <I>x</I>. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>10.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>The intent
is that S'Denorm be True when such denormalized numbers exist and are
generated in the circumstances defined by IEC 559:1989, though the latter
requirement is not formalized here. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Machine_Rounds<DD Class="Hanging">
<A NAME="I5649"></A><A NAME="I5650"></A>Yields the value True if rounding
is performed on inexact results of every predefined operation that yields
a result of the type <I>T</I>; yields the value False otherwise. The
value of this attribute is of the predefined type Boolean. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>11.a</FONT></DIV>
<DIV Class="Annotations" Style="margin-bottom: 0.4em"><FONT SIZE=-1><B>Discussion:
</B>It is difficult to be more precise about what it means to round the
result of a predefined operation. If the implementation does not use
extended registers, so that every arithmetic result is necessarily a
machine number, then rounding seems to imply two things: </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>11.b</FONT></DIV>
<UL Class="SmallBulleted"><FONT SIZE=-1><LI TYPE=DISC>S'Model_Mantissa = S'Machine_Mantissa, so that operand
preperturbation never occurs;</LI></FONT></UL>
<DIV Class="Paranum"><FONT SIZE=-2>11.c</FONT></DIV>
<UL Class="SmallBulleted"><FONT SIZE=-1><LI TYPE=DISC>when the exact mathematical result is not a machine number,
the result of a predefined operation must be the nearer of the two adjacent
machine numbers. </LI></FONT></UL>
<DIV Class="Paranum"><FONT SIZE=-2>11.d</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Technically, this attribute should
yield False when extended registers are used, since a few computed results
will cross over the half-way point as a result of double rounding, if
and when a value held in an extended register has to be reduced in precision
to that of the machine numbers. It does not seem desirable to preclude
the use of extended registers when S'Machine_Rounds could otherwise be
True. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>12</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Machine_Overflows<DD Class="Hanging">
<A NAME="I5651"></A><A NAME="I5652"></A>Yields the value True if overflow
and divide-by-zero are detected and reported by raising Constraint_Error
for every predefined operation that yields a result of the type <I>T</I>;
yields the value False otherwise. The value of this attribute is of the
predefined type Boolean.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>13</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Signed_Zeros<DD Class="Hanging">
<A NAME="I5653"></A><A NAME="I5654"></A>Yields the value True if the
hardware representation for the type <I>T</I> has the capability of representing
both positively and negatively signed zeros, these being generated and
used by the predefined operations of the type <I>T</I> as specified in
IEC 559:1989; yields the value False otherwise. The value of this attribute
is of the predefined type Boolean. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>14</FONT></DIV>
<DIV Class="Normal" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I5655"></A>For
every value <I>x</I> of a floating point type <I>T</I>, the <I>normalized
exponent</I> of <I>x</I> is defined as follows: </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>15</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>the normalized exponent of zero is (by convention) zero;</LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>16</FONT></DIV>
<UL Class="Bulleted"><LI TYPE=DISC>for nonzero <I>x</I>, the normalized exponent of <I>x</I>
is the unique integer <I>k</I> such that <I>T</I>'Machine_Radix<SUP><FONT SIZE=+1><FONT SIZE=-2><I>k</I>-1</FONT></FONT></SUP>
<= |<I>x</I>| &lt; <I>T</I>'Machine_Radix<SUP><FONT SIZE=+1><FONT SIZE=-2><I>k</I></FONT></FONT></SUP>.
</LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>16.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>The normalized
exponent of a normalized number <I>x</I> is the value of <I>exponent</I>
in the canonical-form representation of <I>x</I>.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>16.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>The normalized exponent of a denormalized
number is less than the value of <I>T</I>'Machine_Emin. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>17</FONT></DIV>
<DIV Class="Wide" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I5656"></A>The
following <I>primitive function attributes</I> are defined for any subtype
S of a floating point type <I>T</I>. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>18</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Exponent<DD Class="Hanging">
<A NAME="I5657"></A><A NAME="I5658"></A>S'Exponent denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>19</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Exponent&nbsp;(<I>X</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>universal_integer</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>20</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging">The function yields the normalized exponent of <I>X</I>.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>21</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Fraction<DD Class="Hanging">
<A NAME="I5659"></A><A NAME="I5660"></A>S'Fraction denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>22</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Fraction&nbsp;(<I>X</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>23</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging">The function yields the value <I>X</I> &middot;
<I>T</I>'Machine_Radix<SUP><FONT SIZE=+1><FONT SIZE=-2>-<I>k</I></FONT></FONT></SUP>,
where <I>k</I> is the normalized exponent of <I>X</I>. A zero result[,
which can only occur when <I>X</I> is zero,] has the sign of <I>X</I>.
</DL>
<DIV Class="Paranum"><FONT SIZE=-2>23.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>Informally,
when <I>X</I> is a normalized number, the result is the value obtained
by replacing the <I>exponent</I> by zero in the canonical-form representation
of <I>X</I>. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>23.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>Except when
<I>X</I> is zero, the magnitude of the result is greater than or equal
to the reciprocal of <I>T</I>'Machine_Radix and less than one; consequently,
the result is always a normalized number, even when <I>X</I> is a denormalized
number. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>23.c</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Implementation Note: </B>When
<I>X</I> is a denormalized number, the result is the value obtained by
replacing the <I>exponent</I> by zero in the canonical-form representation
of the result of scaling <I>X</I> up sufficiently to normalize it. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>24</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Compose<DD Class="Hanging">
<A NAME="I5661"></A><A NAME="I5662"></A>S'Compose denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>25</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Compose&nbsp;(<I>Fraction</I>&nbsp;:&nbsp;<I>T</I>;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<I>Exponent</I>&nbsp;:&nbsp;<I>universal_integer</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>26</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging"><A NAME="I5663"></A>Let <I>v</I> be the value <I>Fraction</I>
&middot; <I>T</I>'Machine_Radix<SUP><FONT SIZE=+1><FONT SIZE=-2><I>Exponent</I>-<I>k</I></FONT></FONT></SUP>,
where <I>k</I> is the normalized exponent of <I>Fraction</I>. If <I>v</I>
is a machine number of the type <I>T</I>, or if |<I>v</I>| >= <I>T</I>'Model_Small,
the function yields <I>v</I>; otherwise, it yields either one of the
machine numbers of the type <I>T</I> adjacent to <I>v</I>. <A NAME="I5664"></A><A NAME="I5665"></A>Constraint_Error
is optionally raised if <I>v</I> is outside the base range of S. A zero
result has the sign of <I>Fraction</I> when S'Signed_Zeros is True. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>26.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>Informally,
when <I>Fraction</I> and <I>v</I> are both normalized numbers, the result
is the value obtained by replacing the <I>exponent</I> by <I>Exponent</I>
in the canonical-form representation of <I>Fraction</I>. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>26.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>If <I>Exponent</I>
is less than <I>T</I>'Machine_Emin and <I>Fraction</I> is nonzero, the
result is either zero, <I>T</I>'Model_Small, or (if <I>T</I>'Denorm is
True) a denormalized number. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>27</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Scaling<DD Class="Hanging">
<A NAME="I5666"></A><A NAME="I5667"></A>S'Scaling denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>28</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Scaling&nbsp;(<I>X</I>&nbsp;:&nbsp;<I>T</I>;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<I>Adjustment</I>&nbsp;:&nbsp;<I>universal_integer</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>29</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging"><A NAME="I5668"></A>Let <I>v</I> be the value <I>X</I>
&middot; <I>T</I>'Machine_Radix<SUP><FONT SIZE=+1><FONT SIZE=-2><I>Adjustment</I></FONT></FONT></SUP>.
If <I>v</I> is a machine number of the type <I>T</I>, or if |<I>v</I>|
>= <I>T</I>'Model_Small, the function yields <I>v</I>; otherwise, it
yields either one of the machine numbers of the type <I>T</I> adjacent
to <I>v</I>. <A NAME="I5669"></A><A NAME="I5670"></A>Constraint_Error
is optionally raised if <I>v</I> is outside the base range of S. A zero
result has the sign of <I>X</I> when S'Signed_Zeros is True. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>29.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>Informally,
when <I>X</I> and <I>v</I> are both normalized numbers, the result is
the value obtained by increasing the <I>exponent</I> by <I>Adjustment</I>
in the canonical-form representation of <I>X</I>. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>29.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>If <I>Adjustment</I>
is sufficiently small (i.e., sufficiently negative), the result is either
zero, <I>T</I>'Model_Small, or (if <I>T</I>'Denorm is True) a denormalized
number. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>30</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Floor<DD Class="Hanging">
<A NAME="I5671"></A><A NAME="I5672"></A>S'Floor denotes a function with
the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>31</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Floor&nbsp;(<I>X</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>32</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging">The function yields the value <I>Floor</I>(<I>X</I>),
i.e., the largest (most positive) integral value less than or equal to
<I>X</I>. When <I>X</I> is zero, the result has the sign of <I>X</I>;
a zero result otherwise has a positive sign.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>33</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Ceiling<DD Class="Hanging">
<A NAME="I5673"></A><A NAME="I5674"></A>S'Ceiling denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>34</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Ceiling&nbsp;(<I>X</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>35</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging">The function yields the value <I>Ceiling</I>(<I>X</I>),
i.e., the smallest (most negative) integral value greater than or equal
to <I>X</I>. When <I>X</I> is zero, the result has the sign of <I>X</I>;
a zero result otherwise has a negative sign when S'Signed_Zeros is True.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>36</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Rounding<DD Class="Hanging">
<A NAME="I5675"></A><A NAME="I5676"></A>S'Rounding denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>37</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Rounding&nbsp;(<I>X</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>38</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging">The function yields the integral value nearest to
<I>X</I>, rounding away from zero if <I>X</I> lies exactly halfway between
two integers. A zero result has the sign of <I>X</I> when S'Signed_Zeros
is True.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>39</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Unbiased_Rounding<DD Class="Hanging">
<A NAME="I5677"></A><A NAME="I5678"></A>S'Unbiased_Rounding denotes a
function with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>40</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Unbiased_Rounding&nbsp;(<I>X</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>41</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging">The function yields the integral value nearest to
<I>X</I>, rounding toward the even integer if <I>X</I> lies exactly halfway
between two integers. A zero result has the sign of <I>X</I> when S'Signed_Zeros
is True.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>42</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Truncation<DD Class="Hanging">
<A NAME="I5679"></A><A NAME="I5680"></A>S'Truncation denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>43</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Truncation&nbsp;(<I>X</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>44</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging">The function yields the value <I>Ceiling</I>(<I>X</I>)
when <I>X</I> is negative, and <I>Floor</I>(<I>X</I>) otherwise. A zero
result has the sign of <I>X</I> when S'Signed_Zeros is True.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>45</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Remainder<DD Class="Hanging">
<A NAME="I5681"></A><A NAME="I5682"></A>S'Remainder denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>46</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Remainder&nbsp;(<I>X</I>,&nbsp;<I>Y</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>47</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging"><A NAME="I5683"></A>For nonzero <I>Y</I>, let <I>v</I>
be the value <I>X</I> - <I>n</I> &middot; <I>Y</I>, where <I>n</I> is
the integer nearest to the exact value of <I>X</I>/<I>Y</I>; if |<I>n</I>
- <I>X</I>/<I>Y</I>|   =   1/2, then <I>n</I> is chosen to be even. If
<I>v</I> is a machine number of the type <I>T</I>, the function yields
<I>v</I>; otherwise, it yields zero. <A NAME="I5684"></A><A NAME="I5685"></A>Constraint_Error
is raised if <I>Y</I> is zero. A zero result has the sign of <I>X</I>
when S'Signed_Zeros is True. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>47.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>The magnitude
of the result is less than or equal to one-half the magnitude of <I>Y</I>.
</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>47.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>Given machine
numbers <I>X</I> and <I>Y</I> of the type <I>T</I>, <I>v</I> is necessarily
a machine number of the type <I>T</I>, except when <I>Y</I> is in the
neighborhood of zero, <I>X</I> is sufficiently close to a multiple of
<I>Y</I>, and <I>T</I>'Denorm is False. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>48</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Adjacent<DD Class="Hanging">
<A NAME="I5686"></A><A NAME="I5687"></A>S'Adjacent denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>49</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Adjacent&nbsp;(<I>X</I>,&nbsp;<I>Towards</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>50</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging"><A NAME="I5688"></A>If <I>Towards</I>   =   <I>X</I>,
the function yields <I>X</I>; otherwise, it yields the machine number
of the type <I>T</I> adjacent to <I>X</I> in the direction of <I>Towards</I>,
if that machine number exists. <A NAME="I5689"></A><A NAME="I5690"></A>If
the result would be outside the base range of S, Constraint_Error is
raised. When <I>T</I>'Signed_Zeros is True, a zero result has the sign
of <I>X</I>. When <I>Towards</I> is zero, its sign has no bearing on
the result. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>50.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Ramification: </B>The value
of S'Adjacent(0.0, 1.0) is the smallest normalized positive number of
the type <I>T</I> when <I>T</I>'Denorm is False and the smallest denormalized
positive number of the type <I>T</I> when <I>T</I>'Denorm is True. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>51</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Copy_Sign<DD Class="Hanging">
<A NAME="I5691"></A><A NAME="I5692"></A>S'Copy_Sign denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>52</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Copy_Sign&nbsp;(<I>Value</I>,&nbsp;<I>Sign</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>53</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging"><A NAME="I5693"></A>If the value of <I>Value</I>
is nonzero, the function yields a result whose magnitude is that of <I>Value</I>
and whose sign is that of <I>Sign</I>; otherwise, it yields the value
zero. <A NAME="I5694"></A><A NAME="I5695"></A>Constraint_Error is optionally
raised if the result is outside the base range of S. A zero result has
the sign of <I>Sign</I> when S'Signed_Zeros is True. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>53.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>S'Copy_Sign
is provided for convenience in restoring the sign to a quantity from
which it has been temporarily removed, or to a related quantity. When
S'Signed_Zeros is True, it is also instrumental in determining the sign
of a zero quantity, when required. (Because negative and positive zeros
compare equal in systems conforming to IEC 559:1989, a negative zero
does <I>not</I> appear to be negative when compared to zero.) The sign
determination is accomplished by transferring the sign of the zero quantity
to a nonzero quantity and then testing for a negative result. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>54</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Leading_Part<DD Class="Hanging">
<A NAME="I5696"></A><A NAME="I5697"></A>S'Leading_Part denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>55</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Leading_Part&nbsp;(<I>X</I>&nbsp;:&nbsp;<I>T</I>;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<I>Radix_Digits</I>&nbsp;:&nbsp;<I>universal_integer</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>56</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging">Let <I>v</I> be the value <I>T</I>'Machine_Radix<SUP><FONT SIZE=+1><FONT SIZE=-2><I>k</I>-<I>Radix_Digits</I></FONT></FONT></SUP>,
where <I>k</I> is the normalized exponent of <I>X</I>. The function yields
the value </DL>
<DIV Class="Paranum"><FONT SIZE=-2>57</FONT></DIV>
<UL Class="IndentedBulleted"><LI TYPE=DISC><I>Floor</I>(<I>X</I>/<I>v</I>) &middot; <I>v</I>, when
<I>X</I> is nonnegative and <I>Radix_Digits</I> is positive;</LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>58</FONT></DIV>
<UL Class="IndentedBulleted"><LI TYPE=DISC><I>Ceiling</I>(<I>X</I>/<I>v</I>) &middot; <I>v</I>, when
<I>X</I> is negative and <I>Radix_Digits</I> is positive. </LI></UL>
<DIV Class="Paranum"><FONT SIZE=-2>59</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging"><A NAME="I5698"></A><A NAME="I5699"></A><A NAME="I5700"></A>Constraint_Error
is raised when <I>Radix_Digits</I> is zero or negative. A zero result[,
which can only occur when <I>X</I> is zero,] has the sign of <I>X</I>.
</DL>
<DIV Class="Paranum"><FONT SIZE=-2>59.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>Informally,
if <I>X</I> is nonzero, the result is the value obtained by retaining
only the specified number of (leading) significant digits of <I>X</I>
(in the machine radix), setting all other digits to zero. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>59.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Implementation Note: </B>The
result can be obtained by first scaling <I>X</I> up, if necessary to
normalize it, then masking the mantissa so as to retain only the specified
number of leading digits, then scaling the result back down if <I>X</I>
was scaled up. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>60</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Machine<DD Class="Hanging">
<A NAME="I5701"></A><A NAME="I5702"></A>S'Machine denotes a function
with the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>61</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Machine&nbsp;(<I>X</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>62</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging"><A NAME="I5703"></A>If <I>X</I> is a machine number
of the type <I>T</I>, the function yields <I>X</I>; otherwise, it yields
the value obtained by rounding or truncating <I>X</I> to either one of
the adjacent machine numbers of the type <I>T</I>. <A NAME="I5704"></A><A NAME="I5705"></A>Constraint_Error
is raised if rounding or truncating <I>X</I> to the precision of the
machine numbers results in a value outside the base range of S. A zero
result has the sign of <I>X</I> when S'Signed_Zeros is True. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>62.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>All of the
primitive function attributes except Rounding and Machine correspond
to subprograms in the Generic_Primitive_Functions generic package proposed
as a separate ISO standard (ISO/IEC DIS 11729) for Ada 83. The Scaling,
Unbiased_Rounding, and Truncation attributes correspond to the Scale,
Round, and Truncate functions, respectively, in Generic_Primitive_Functions.
The Rounding attribute rounds away from zero; this functionality was
not provided in Generic_Primitive_Functions. The name Round was not available
for either of the primitive function attributes that perform rounding,
since an attribute of that name is used for a different purpose for decimal
fixed point types. Likewise, the name Scale was not available, since
an attribute of that name is also used for a different purpose for decimal
fixed point types. The functionality of the Machine attribute was also
not provided in Generic_Primitive_Functions. The functionality of the
Decompose procedure of Generic_Primitive_Functions is only provided in
the form of the separate attributes Exponent and Fraction. The functionality
of the Successor and Predecessor functions of Generic_Primitive_Functions
is provided by the extension of the existing Succ and Pred attributes.
</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>62.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Implementation Note: </B>The
primitive function attributes may be implemented either with appropriate
floating point arithmetic operations or with integer and logical operations
that act on parts of the representation directly. The latter is strongly
encouraged when it is more efficient than the former; it is mandatory
when the former cannot deliver the required accuracy due to limitations
of the implementation's arithmetic operations. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>63</FONT></DIV>
<DIV Class="Wide" Style="margin-bottom: 0.4em">&nbsp;&nbsp;&nbsp;&nbsp;<A NAME="I5706"></A>The
following <I>model-oriented attributes</I> are defined for any subtype
S of a floating point type <I>T</I>. </DIV>
<DIV Class="Paranum"><FONT SIZE=-2>64</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Model_Mantissa<DD Class="Hanging">
<A NAME="I5707"></A><A NAME="I5708"></A>If the Numerics Annex is not
supported, this attribute yields an implementation defined value that
is greater than or equal to <I>Ceiling</I>(<I>d</I> &middot; log(10)
/ log(<I>T</I>'Machine_Radix)) + 1, where <I>d</I> is the requested decimal
precision of <I>T</I>, and less than or equal to the value of <I>T</I>'Machine_Mantissa.
See <A HREF="AA-G-2-2.html">G.2.2</A> for further requirements that apply
to implementations supporting the Numerics Annex. The value of this attribute
is of the type <I>universal_integer</I>.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>65</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Model_Emin<DD Class="Hanging">
<A NAME="I5709"></A><A NAME="I5710"></A>If the Numerics Annex is not
supported, this attribute yields an implementation defined value that
is greater than or equal to the value of <I>T</I>'Machine_Emin. See <A HREF="AA-G-2-2.html">G.2.2</A>
for further requirements that apply to implementations supporting the
Numerics Annex. The value of this attribute is of the type <I>universal_integer</I>.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>66</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Model_Epsilon<DD Class="Hanging">
<A NAME="I5711"></A><A NAME="I5712"></A>Yields the value <I>T</I>'Machine_Radix<SUP><FONT SIZE=+1><FONT SIZE=-2>1
- <I>T</I>'Model_Mantissa</FONT></FONT></SUP>. The value of this attribute
is of the type <I>universal_real</I>. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>66.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>In most implementations,
this attribute yields the absolute value of the difference between one
and the smallest machine number of the type <I>T</I> above one which,
when added to one, yields a machine number different from one. Further
discussion can be found in <A HREF="AA-G-2-2.html">G.2.2</A>. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>67</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Model_Small<DD Class="Hanging">
<A NAME="I5713"></A><A NAME="I5714"></A>Yields the value <I>T</I>'Machine_Radix<SUP><FONT SIZE=+1><FONT SIZE=-2><I>T</I>'Model_Emin
- 1</FONT></FONT></SUP>. The value of this attribute is of the type <I>universal_real</I>.
</DL>
<DIV Class="Paranum"><FONT SIZE=-2>67.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>In most implementations,
this attribute yields the smallest positive normalized number of the
type <I>T</I>, i.e. the number corresponding to the positive underflow
threshold. In some implementations employing a radix-complement representation
for the type <I>T</I>, the positive underflow threshold is closer to
zero than is the negative underflow threshold, with the consequence that
the smallest positive normalized number does not coincide with the positive
underflow threshold (i.e., it exceeds the latter). Further discussion
can be found in <A HREF="AA-G-2-2.html">G.2.2</A>. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>68</FONT></DIV>
<DL Class="Hanging" Style="margin-bottom: 0.4em"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Model<DD Class="Hanging">
<A NAME="I5715"></A><A NAME="I5716"></A>S'Model denotes a function with
the following specification: </DL>
<DIV Class="Paranum"><FONT SIZE=-2>69</FONT></DIV>
<DIV Class="IndentedExamples"><TT><B>function</B>&nbsp;S'Model&nbsp;(<I>X</I>&nbsp;:&nbsp;<I>T</I>)<BR>
&nbsp;&nbsp;<B>return</B>&nbsp;<I>T</I></TT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>70</FONT></DIV>
<DL Class="Hanging"><DD Class ="Hanging">If the Numerics Annex is not supported, the meaning
of this attribute is implementation defined; see <A HREF="AA-G-2-2.html">G.2.2</A>
for the definition that applies to implementations supporting the Numerics
Annex.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>71</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Safe_First<DD Class="Hanging">
<A NAME="I5717"></A><A NAME="I5718"></A>Yields the lower bound of the
safe range (see <A HREF="AA-3-5-7.html">3.5.7</A>) of the type <I>T</I>.
If the Numerics Annex is not supported, the value of this attribute is
implementation defined; see <A HREF="AA-G-2-2.html">G.2.2</A> for the
definition that applies to implementations supporting the Numerics Annex.
The value of this attribute is of the type <I>universal_real</I>.</DL>
<DIV Class="Paranum"><FONT SIZE=-2>72</FONT></DIV>
<DL Class="Hanging"><DT>&nbsp;&nbsp;&nbsp;&nbsp;S'Safe_Last<DD Class="Hanging">
<A NAME="I5719"></A><A NAME="I5720"></A>Yields the upper bound of the
safe range (see <A HREF="AA-3-5-7.html">3.5.7</A>) of the type <I>T</I>.
If the Numerics Annex is not supported, the value of this attribute is
implementation defined; see <A HREF="AA-G-2-2.html">G.2.2</A> for the
definition that applies to implementations supporting the Numerics Annex.
The value of this attribute is of the type <I>universal_real</I>. </DL>
<DIV Class="Paranum"><FONT SIZE=-2>72.a</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Discussion: </B>A predefined
floating point arithmetic operation that yields a value in the safe range
of its result type is guaranteed not to overflow. </FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>72.b</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>To be honest: </B>An exception
is made for exponentiation by a negative exponent in <A HREF="AA-4-5-6.html">4.5.6</A>.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>72.c</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><B>Implementation defined: </B>The
values of the Model_Mantissa, Model_Emin, Model_Epsilon, Model, Safe_First,
and Safe_Last attributes, if the Numerics Annex is not supported.</FONT></DIV>

<H4 ALIGN=CENTER>Incompatibilities With Ada 83</H4>
<DIV Class="Paranum"><FONT SIZE=-2>72.d</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><A NAME="I5721"></A>The Epsilon
and Mantissa attributes of floating point types are removed from the
language and replaced by Model_Epsilon and Model_Mantissa, which may
have different values (as a result of changes in the definition of model
numbers); the replacement of one set of attributes by another is intended
to convert what would be an inconsistent change into an incompatible
change.</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>72.e</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>The Emax, Small, Large, Safe_Emax,
Safe_Small, and Safe_Large attributes of floating point types are removed
from the language. Small and Safe_Small are collectively replaced by
Model_Small, which is functionally equivalent to Safe_Small, though it
may have a slightly different value. The others are collectively replaced
by Safe_First and Safe_Last. Safe_Last is functionally equivalent to
Safe_Large, though it may have a different value; Safe_First is comparable
to the negation of Safe_Large but may differ slightly from it as well
as from the negation of Safe_Last. Emax and Safe_Emax had relatively
few uses in Ada 83; T'Safe_Emax can be computed in the revised language
as Integer'Min(T'Exponent(T'Safe_First), T'Exponent(T'Safe_Last)).</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>72.f</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>Implementations are encouraged
to eliminate the incompatibilities discussed here by retaining the old
attributes, during a transition period, in the form of implementation-defined
attributes with their former values. </FONT></DIV>

<H4 ALIGN=CENTER>Extensions to Ada 83</H4>
<DIV Class="Paranum"><FONT SIZE=-2>72.g</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1><A NAME="I5722"></A>The Model_Emin
attribute is new. It is conceptually similar to the negation of Safe_Emax
attribute of Ada 83, adjusted for the fact that the model numbers now
have the hardware radix. It is a fundamental determinant, along with
Model_Mantissa, of the set of model numbers of a type (see <A HREF="AA-G-2-1.html">G.2.1</A>).</FONT></DIV>
<DIV Class="Paranum"><FONT SIZE=-2>72.h</FONT></DIV>
<DIV Class="Annotations"><FONT SIZE=-1>The Denorm and Signed_Zeros attributes
are new, as are all of the primitive function attributes. </FONT></DIV>

<HR>
<P><A HREF="AA-TOC.html">Contents</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-0-29.html">Index</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-A-5-2.html">Previous</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-A-5-4.html">Next</A>&nbsp;&nbsp;&nbsp;<A HREF="AA-TTL.html">Legal</A></P>
</BODY>
</HTML>