Skip to content

Commit 6d11cb0

Browse files
committed
Editorial change: correcting project name in code examples
1 parent 2dedef7 commit 6d11cb0

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

content/courses/advanced-ada/parts/data_types/numeric_attributes.rst

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ universal integer value. Let's get the modulus of the 32-bit :ada:`Modular`
2424
type that we've declared in the :ada:`Num_Types` package of the previous
2525
chapter:
2626

27-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Modular_Types.Modular_1
27+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Modular_Types.Modular_1
2828

2929
package Num_Types is
3030

@@ -69,7 +69,7 @@ be something like :ada:`-2**31 .. 2**31 - 1`. (Note: we discussed the
6969
Operations on modular integers use modular (wraparound) arithmetic. For
7070
example:
7171

72-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Modular_Types.Modular_1
72+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Modular_Types.Modular_1
7373

7474
with Ada.Text_IO; use Ada.Text_IO;
7575

@@ -94,7 +94,7 @@ wrap around)? The answer in Ada is the former |mdash| that is, if you try to
9494
convert, say, :ada:`Integer'(-1)` to :ada:`Modular`, you will get
9595
:ada:`Constraint_Error`:
9696

97-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Modular_Types.Modular_1
97+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Modular_Types.Modular_1
9898
:class: ada-run-expect-failure
9999

100100
with Ada.Text_IO; use Ada.Text_IO;
@@ -111,7 +111,7 @@ convert, say, :ada:`Integer'(-1)` to :ada:`Modular`, you will get
111111

112112
To solve this problem, we can use the :ada:`Mod` attribute:
113113

114-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Modular_Types.Modular_1
114+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Modular_Types.Modular_1
115115

116116
with Ada.Text_IO; use Ada.Text_IO;
117117

@@ -140,7 +140,7 @@ given modular type, using wraparound semantics.
140140
The :ada:`Mod` attribute was added to Ada 2005 to solve this problem.
141141
Also, we can now safely use this attribute in generics. For example:
142142

143-
.. code:: ada compile_button project=Courses.Advanced_Ada.Data_Types.Numerics.Modular_Types.Mod_Attribute
143+
.. code:: ada compile_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Modular_Types.Mod_Attribute
144144

145145
generic
146146
type Formal_Modular is mod <>;
@@ -180,7 +180,7 @@ performed.
180180

181181
Let's see a simple implementation of the CRC-CCITT (0x1D0F) algorithm:
182182

183-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Modular_Types.Mod_Crc_CCITT_Ada
183+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Modular_Types.Mod_Crc_CCITT_Ada
184184

185185
package Crc_Defs is
186186

@@ -298,7 +298,7 @@ Attribute: :ada:`Machine_Radix`
298298
:ada:`Machine_Radix` is an attribute that returns the radix of the hardware
299299
representation of a type. For example:
300300

301-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Machine_Radix
301+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Machine_Radix
302302

303303
with Ada.Text_IO; use Ada.Text_IO;
304304

@@ -324,7 +324,7 @@ Attributes: :ada:`Machine_Mantissa`
324324
:ada:`Machine_Mantissa` is an attribute that returns the number of bits
325325
reserved for the mantissa of the floating-point type. For example:
326326

327-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Machine_Mantissa
327+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Machine_Mantissa
328328

329329
with Ada.Text_IO; use Ada.Text_IO;
330330

@@ -352,7 +352,7 @@ and maximum value, respectively, of the machine exponent the floating-point
352352
type. Note that, in all cases, the returned value is a universal integer. For
353353
example:
354354

355-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Machine_Emin_Emax
355+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Machine_Emin_Emax
356356

357357
with Ada.Text_IO; use Ada.Text_IO;
358358

@@ -405,7 +405,7 @@ Attribute: :ada:`Digits`
405405
:ada:`Digits` is an attribute that returns the requested decimal precision of
406406
a floating-point subtype. Let's see an example:
407407

408-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Digits
408+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Digits
409409

410410
with Ada.Text_IO; use Ada.Text_IO;
411411

@@ -425,7 +425,7 @@ Note that we said that :ada:`Digits` is the *requested* level of precision,
425425
which is specified as part of declaring a floating point type. We can retrieve
426426
the actual decimal precision with :ada:`Base'Digits`. For example:
427427

428-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Base_Digits
428+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Base_Digits
429429

430430
with Ada.Text_IO; use Ada.Text_IO;
431431

@@ -462,7 +462,7 @@ indicating whether a feature is available or not in the target architecture:
462462
:ada:`Constraint_Error` exception is (or is not) guaranteed to be raised
463463
when an operation with that type produces an overflow or divide-by-zero.
464464

465-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Machine_Rounds_Overflows
465+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Machine_Rounds_Overflows
466466

467467
with Ada.Text_IO; use Ada.Text_IO;
468468

@@ -541,7 +541,7 @@ floating-point value:
541541

542542
Let's see some examples:
543543

544-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Exponent_Fraction
544+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Exponent_Fraction
545545

546546
with Ada.Text_IO; use Ada.Text_IO;
547547

@@ -600,7 +600,7 @@ Attribute: :ada:`Scaling`
600600
:ada:`Scaling` is an attribute that scales a floating-point value based on the
601601
machine radix and a machine exponent passed to the function. For example:
602602

603-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Scaling
603+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Scaling
604604

605605
with Ada.Text_IO; use Ada.Text_IO;
606606

@@ -629,7 +629,7 @@ Round-up and round-down attributes
629629
:ada:`Floor` and :ada:`Ceiling` are attributes that returned the rounded-down
630630
or rounded-up value, respectively, of a floating-point value. For example:
631631

632-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Floor_Ceiling
632+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Floor_Ceiling
633633

634634
with Ada.Text_IO; use Ada.Text_IO;
635635

@@ -655,7 +655,7 @@ is the closest integer value.
655655

656656
Let's see a code example:
657657

658-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Rounding
658+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Rounding
659659

660660
with Ada.Text_IO; use Ada.Text_IO;
661661

@@ -752,7 +752,7 @@ second parameter is the :ada:`Towards` value.
752752

753753
Let's see a code example:
754754

755-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Truncation_Remainder
755+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Truncation_Remainder
756756

757757
with Ada.Text_IO; use Ada.Text_IO;
758758

@@ -837,7 +837,7 @@ mantissa. Let's see some examples:
837837

838838
Let's see some examples:
839839

840-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Sign_Leading
840+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Sign_Leading
841841

842842
with Ada.Text_IO; use Ada.Text_IO;
843843

@@ -879,7 +879,7 @@ Not every real number is directly representable as a floating-point value on a
879879
specific machine. For example, let's take a value such as 1.0 x 10\ :sup:`15`
880880
(or 1,000,000,000,000,000):
881881

882-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Float_Value
882+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Float_Value
883883

884884
with Ada.Text_IO; use Ada.Text_IO;
885885

@@ -932,7 +932,7 @@ the difference between the original real value in our example
932932
(1.0 x 10\ :sup:`15`) and the actual value that is assigned to :ada:`V`. We can
933933
do this by using the :ada:`Machine` attribute in the calculation:
934934

935-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Machine_Attribute
935+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Machine_Attribute
936936

937937
with Ada.Text_IO; use Ada.Text_IO;
938938

@@ -1028,7 +1028,7 @@ This is the reason why we see 1.3008896 x 10\ :sup:`7` instead of
10281028

10291029
Let's see an example:
10301030

1031-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Model_Mantissa
1031+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Model_Mantissa
10321032

10331033
with Ada.Text_IO; use Ada.Text_IO;
10341034

@@ -1075,7 +1075,7 @@ This is the reason why we see 1.3008896 x 10\ :sup:`7` instead of
10751075

10761076
Let's see some examples:
10771077

1078-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Model_Epsilon_Small
1078+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Model_Epsilon_Small
10791079

10801080
with Ada.Text_IO; use Ada.Text_IO;
10811081

@@ -1118,7 +1118,7 @@ This is the reason why we see 1.3008896 x 10\ :sup:`7` instead of
11181118
value in 1.0 x 10\ :sup:`15` and the actual model value, we can use the
11191119
:ada:`Model` attribute:
11201120

1121-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Model_Attribute
1121+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Model_Attribute
11221122

11231123
with Ada.Text_IO; use Ada.Text_IO;
11241124

@@ -1169,7 +1169,7 @@ This is the reason why we see 1.3008896 x 10\ :sup:`7` instead of
11691169
Let's see a code example with these attributes and compare them to the
11701170
:ada:`First` and :ada:`Last` attributes:
11711171

1172-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Floating_Point_Types.Safe_First_Last
1172+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Floating_Point_Types.Safe_First_Last
11731173

11741174
with Ada.Text_IO; use Ada.Text_IO;
11751175

@@ -1229,7 +1229,7 @@ Attribute: :ada:`Machine_Radix`
12291229
:ada:`Machine_Radix` is an attribute that returns the radix of the hardware
12301230
representation of a type. For example:
12311231

1232-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Fixed_Point_Types.Fixed_Machine_Radix
1232+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Fixed_Point_Types.Fixed_Machine_Radix
12331233

12341234
with Ada.Text_IO; use Ada.Text_IO;
12351235

@@ -1265,7 +1265,7 @@ indicating whether a feature is available or not in the target architecture:
12651265
:ada:`Constraint_Error` is guaranteed to be raised when a fixed-point
12661266
operation with that type produces an overflow or divide-by-zero.
12671267

1268-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Fixed_Point_Types.Fixed_Machine_Rounds_Overflows
1268+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Fixed_Point_Types.Fixed_Machine_Rounds_Overflows
12691269

12701270
with Ada.Text_IO; use Ada.Text_IO;
12711271

@@ -1314,7 +1314,7 @@ it's automatically selected by the compiler, and it's always equal to the
13141314

13151315
Let's see an example:
13161316

1317-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Fixed_Point_Types.Fixed_Small_Delta
1317+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Fixed_Point_Types.Fixed_Small_Delta
13181318

13191319
package Fixed_Small_Delta is
13201320
D3 : constant := 10.0 ** (-3);
@@ -1386,7 +1386,7 @@ In the case of the :ada:`TQ15` type, we're specifying the *small* by using the
13861386
type is 32 bits, while the precision we get when operating with this type is
13871387
16 bits. Let's see a specific example for this type:
13881388

1389-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Fixed_Point_Types.Fixed_Small_Delta
1389+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Fixed_Point_Types.Fixed_Small_Delta
13901390

13911391
with Ada.Text_IO; use Ada.Text_IO;
13921392

@@ -1431,7 +1431,7 @@ precise:
14311431

14321432
Let's see an example:
14331433

1434-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Fixed_Point_Types.Fixed_Fore_Aft
1434+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Fixed_Point_Types.Fixed_Fore_Aft
14351435

14361436
with Ada.Text_IO; use Ada.Text_IO;
14371437

@@ -1485,7 +1485,7 @@ use for the :ada:`digits` in the definition of a decimal fixed-point type.
14851485

14861486
Let's see an example:
14871487

1488-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Fixed_Point_Types.Decimal_Digits
1488+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Fixed_Point_Types.Decimal_Digits
14891489

14901490
with Ada.Text_IO; use Ada.Text_IO;
14911491

@@ -1527,7 +1527,7 @@ of :ada:`T'Scale` is three.
15271527

15281528
Let's look at this complete example:
15291529

1530-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Fixed_Point_Types.Decimal_Scale
1530+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Fixed_Point_Types.Decimal_Scale
15311531

15321532
with Ada.Text_IO; use Ada.Text_IO;
15331533

@@ -1570,7 +1570,7 @@ value, while the returned value is of :ada:`S'Base` type.
15701570

15711571
Let's look at this example:
15721572

1573-
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numerics.Fixed_Point_Types.Decimal_Round
1573+
.. code:: ada run_button project=Courses.Advanced_Ada.Data_Types.Numeric_Attributes.Fixed_Point_Types.Decimal_Round
15741574

15751575
with Ada.Text_IO; use Ada.Text_IO;
15761576

0 commit comments

Comments
 (0)