Version 1.3 of ais/ai-00388.txt

Unformatted version of ais/ai-00388.txt version 1.3
Other versions for file ais/ai-00388.txt

!standard A.5(3)          04-12-01 AI95-00388/02
!class amendment 04-11-10
!status Amendment 200Y 04-12-01
!status ARG Approved 8-1-1 04-11-19
!status work item 04-11-10
!status received 04-11-10
!priority Medium
!difficulty Easy
!subject Add Greek pi to Ada.Numerics
!summary
(See proposal.)
!problem
AI95-00285 introduces support for the entire ISO/IEC 10646:2003 character repertoire in source files. In particular, many characters from non-Latin alphabets are now allowed in identifiers.
The identifiers appearing in language-defined units are typically written in English, and therefore use the ASCII subset. In general this is appropriate, and there is no reason to take advantage of the support added by AI95-00285.
One exception to this is the named number Ada.Numerics.Pi. It is universally written using the Greek letter pi in printed text. Having to use the ASCII identifier Pi in numerical algorithms written in Ada degrades the readability of the program text. Being able to use the Greek letter would make it clearer to the reader that a piece of code is using the mathematical number pi, not some random identifier that happens to read PI.
Adding Greek pi to Ada.Numerics is a compatible change because there is currently no code that uses that character as an identifier.
!proposal
Add the following declaration to Ada.Numerics:
<GREEK SMALL LETTER PI> : constant := Pi;
Where <GREEK SMALL LETTER PI> is the character at position 16#03C0#.
<<Author's note: to properly represent Greek pi in the AI I would have to make this file UTF-8, which would probably confuse both the tools and the readers. However, there are already occurrences of this character in the RM, so it shouldn't be a problem to make it look nice and fancy in the final text.>>
!wording
Replace A.5(3) by:
package Ada.Numerics is pragma Pure (Numerics); Argument_Error : exception; Pi : constant := 3.141...; <GREEK SMALL LETTER PI> : constant := Pi; e : constant := 2.718...; end Ada.Numerics;
!discussion
(See proposal.)
!example
No example is needed.
--!corrigendum
!ACATS test
An ACATS test needs to be constructed to check the existence of this declaration.
!appendix

*************************************************************

Questions? Ask the ACAA Technical Agent