home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: Plain text[LF]
| default
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 73 65 | 6e 61 74 6f 72 2d 62 65 |Path: se|nator-be|
|00000010| 64 66 65 6c 6c 6f 77 2e | 6d 69 74 2e 65 64 75 21 |dfellow.|mit.edu!|
|00000020| 62 6c 6f 6f 6d 2d 62 65 | 61 63 6f 6e 2e 6d 69 74 |bloom-be|acon.mit|
|00000030| 2e 65 64 75 21 74 72 69 | 62 75 6e 65 2e 6d 65 69 |.edu!tri|bune.mei|
|00000040| 74 63 61 2e 63 6f 6d 21 | 75 6c 6f 77 65 6c 6c 2e |tca.com!|ulowell.|
|00000050| 75 6d 6c 2e 65 64 75 21 | 65 75 72 6f 70 61 2e 63 |uml.edu!|europa.c|
|00000060| 68 6e 74 2e 67 74 65 67 | 73 63 2e 63 6f 6d 21 6e |hnt.gteg|sc.com!n|
|00000070| 65 77 73 2e 6d 73 66 63 | 2e 6e 61 73 61 2e 67 6f |ews.msfc|.nasa.go|
|00000080| 76 21 65 6c 72 6f 79 2e | 6a 70 6c 2e 6e 61 73 61 |v!elroy.|jpl.nasa|
|00000090| 2e 67 6f 76 21 73 77 72 | 69 6e 64 65 21 74 61 6e |.gov!swr|inde!tan|
|000000a0| 6b 2e 6e 65 77 73 2e 70 | 69 70 65 78 2e 6e 65 74 |k.news.p|ipex.net|
|000000b0| 21 70 69 70 65 78 21 6f | 6c 65 61 6e 65 21 69 6e |!pipex!o|leane!in|
|000000c0| 32 70 33 2e 66 72 21 73 | 77 69 64 69 72 2e 73 77 |2p3.fr!s|widir.sw|
|000000d0| 69 74 63 68 2e 63 68 21 | 65 70 66 6c 6e 65 77 73 |itch.ch!|epflnews|
|000000e0| 21 64 69 6e 65 77 73 2e | 65 70 66 6c 2e 63 68 21 |!dinews.|epfl.ch!|
|000000f0| 4d 61 67 6e 75 73 2e 4b | 65 6d 70 65 0a 46 72 6f |Magnus.K|empe.Fro|
|00000100| 6d 3a 20 4d 61 67 6e 75 | 73 2e 4b 65 6d 70 65 40 |m: Magnu|s.Kempe@|
|00000110| 64 69 2e 65 70 66 6c 2e | 63 68 20 28 4d 61 67 6e |di.epfl.|ch (Magn|
|00000120| 75 73 20 4b 65 6d 70 65 | 29 0a 4e 65 77 73 67 72 |us Kempe|).Newsgr|
|00000130| 6f 75 70 73 3a 20 63 6f | 6d 70 2e 6c 61 6e 67 2e |oups: co|mp.lang.|
|00000140| 61 64 61 2c 63 6f 6d 70 | 2e 61 6e 73 77 65 72 73 |ada,comp|.answers|
|00000150| 2c 6e 65 77 73 2e 61 6e | 73 77 65 72 73 0a 53 75 |,news.an|swers.Su|
|00000160| 62 6a 65 63 74 3a 20 41 | 64 61 20 46 41 51 3a 20 |bject: A|da FAQ: |
|00000170| 50 72 6f 67 72 61 6d 6d | 69 6e 67 20 77 69 74 68 |Programm|ing with|
|00000180| 20 41 64 61 20 28 70 61 | 72 74 20 33 20 6f 66 20 | Ada (pa|rt 3 of |
|00000190| 34 29 0a 46 6f 6c 6c 6f | 77 75 70 2d 54 6f 3a 20 |4).Follo|wup-To: |
|000001a0| 70 6f 73 74 65 72 0a 44 | 61 74 65 3a 20 31 37 20 |poster.D|ate: 17 |
|000001b0| 4d 61 72 20 31 39 39 36 | 20 31 34 3a 32 32 3a 34 |Mar 1996| 14:22:4|
|000001c0| 38 20 47 4d 54 0a 4f 72 | 67 61 6e 69 7a 61 74 69 |8 GMT.Or|ganizati|
|000001d0| 6f 6e 3a 20 4e 6f 6e 65 | 0a 4c 69 6e 65 73 3a 20 |on: None|.Lines: |
|000001e0| 38 32 30 0a 53 65 6e 64 | 65 72 3a 20 6d 61 67 6e |820.Send|er: magn|
|000001f0| 75 73 40 6c 67 6c 73 75 | 6e 34 2e 65 70 66 6c 2e |us@lglsu|n4.epfl.|
|00000200| 63 68 20 28 4d 61 67 6e | 75 73 20 4b 65 6d 70 65 |ch (Magn|us Kempe|
|00000210| 29 0a 41 70 70 72 6f 76 | 65 64 3a 20 6e 65 77 73 |).Approv|ed: news|
|00000220| 2d 61 6e 73 77 65 72 73 | 2d 72 65 71 75 65 73 74 |-answers|-request|
|00000230| 40 4d 49 54 2e 45 44 55 | 0a 44 69 73 74 72 69 62 |@MIT.EDU|.Distrib|
|00000240| 75 74 69 6f 6e 3a 20 77 | 6f 72 6c 64 0a 4d 65 73 |ution: w|orld.Mes|
|00000250| 73 61 67 65 2d 49 44 3a | 20 3c 34 69 68 37 37 6f |sage-ID:| <4ih77o|
|00000260| 24 66 71 32 40 64 69 73 | 75 6e 6d 73 2e 65 70 66 |$fq2@dis|unms.epf|
|00000270| 6c 2e 63 68 3e 0a 52 65 | 70 6c 79 2d 54 6f 3a 20 |l.ch>.Re|ply-To: |
|00000280| 4d 61 67 6e 75 73 2e 4b | 65 6d 70 65 40 64 69 2e |Magnus.K|empe@di.|
|00000290| 65 70 66 6c 2e 63 68 20 | 28 4d 61 67 6e 75 73 20 |epfl.ch |(Magnus |
|000002a0| 4b 65 6d 70 65 29 0a 4e | 4e 54 50 2d 50 6f 73 74 |Kempe).N|NTP-Post|
|000002b0| 69 6e 67 2d 48 6f 73 74 | 3a 20 6c 67 6c 73 75 6e |ing-Host|: lglsun|
|000002c0| 34 2e 65 70 66 6c 2e 63 | 68 0a 4d 69 6d 65 2d 56 |4.epfl.c|h.Mime-V|
|000002d0| 65 72 73 69 6f 6e 3a 20 | 31 2e 30 0a 43 6f 6e 74 |ersion: |1.0.Cont|
|000002e0| 65 6e 74 2d 54 79 70 65 | 3a 20 74 65 78 74 2f 70 |ent-Type|: text/p|
|000002f0| 6c 61 69 6e 3b 20 63 68 | 61 72 73 65 74 3d 69 73 |lain; ch|arset=is|
|00000300| 6f 2d 38 38 35 39 2d 31 | 0a 43 6f 6e 74 65 6e 74 |o-8859-1|.Content|
|00000310| 2d 54 72 61 6e 73 66 65 | 72 2d 45 6e 63 6f 64 69 |-Transfe|r-Encodi|
|00000320| 6e 67 3a 20 38 62 69 74 | 0a 53 75 6d 6d 61 72 79 |ng: 8bit|.Summary|
|00000330| 3a 20 41 64 61 20 50 72 | 6f 67 72 61 6d 6d 65 72 |: Ada Pr|ogrammer|
|00000340| 27 73 20 46 72 65 71 75 | 65 6e 74 6c 79 20 41 73 |'s Frequ|ently As|
|00000350| 6b 65 64 20 51 75 65 73 | 74 69 6f 6e 73 20 28 61 |ked Ques|tions (a|
|00000360| 6e 64 20 61 6e 73 77 65 | 72 73 29 2c 0a 20 20 20 |nd answe|rs),. |
|00000370| 20 20 20 20 20 20 20 20 | 70 61 72 74 20 33 20 6f | |part 3 o|
|00000380| 66 20 34 2e 0a 20 20 20 | 20 20 20 20 20 20 50 6c |f 4.. | Pl|
|00000390| 65 61 73 65 20 72 65 61 | 64 20 62 65 66 6f 72 65 |ease rea|d before|
|000003a0| 20 70 6f 73 74 69 6e 67 | 2e 0a 4b 65 79 77 6f 72 | posting|..Keywor|
|000003b0| 64 73 3a 20 61 64 76 61 | 6e 63 65 64 20 6c 61 6e |ds: adva|nced lan|
|000003c0| 67 75 61 67 65 2c 20 61 | 72 74 69 66 69 63 69 61 |guage, a|rtificia|
|000003d0| 6c 20 6c 61 6e 67 75 61 | 67 65 73 2c 20 63 6f 6d |l langua|ges, com|
|000003e0| 70 75 74 65 72 20 73 6f | 66 74 77 61 72 65 2c 0a |puter so|ftware,.|
|000003f0| 20 20 20 20 20 20 20 20 | 20 20 64 61 74 61 20 70 | | data p|
|00000400| 72 6f 63 65 73 73 69 6e | 67 2c 20 70 72 6f 67 72 |rocessin|g, progr|
|00000410| 61 6d 6d 69 6e 67 20 6c | 61 6e 67 75 61 67 65 73 |amming l|anguages|
|00000420| 2c 20 41 64 61 0a 58 72 | 65 66 3a 20 73 65 6e 61 |, Ada.Xr|ef: sena|
|00000430| 74 6f 72 2d 62 65 64 66 | 65 6c 6c 6f 77 2e 6d 69 |tor-bedf|ellow.mi|
|00000440| 74 2e 65 64 75 20 63 6f | 6d 70 2e 6c 61 6e 67 2e |t.edu co|mp.lang.|
|00000450| 61 64 61 3a 34 32 34 36 | 34 20 63 6f 6d 70 2e 61 |ada:4246|4 comp.a|
|00000460| 6e 73 77 65 72 73 3a 31 | 37 36 30 38 20 6e 65 77 |nswers:1|7608 new|
|00000470| 73 2e 61 6e 73 77 65 72 | 73 3a 36 37 31 36 38 0a |s.answer|s:67168.|
|00000480| 0a 41 72 63 68 69 76 65 | 2d 6e 61 6d 65 3a 20 63 |.Archive|-name: c|
|00000490| 6f 6d 70 75 74 65 72 2d | 6c 61 6e 67 2f 41 64 61 |omputer-|lang/Ada|
|000004a0| 2f 70 72 6f 67 72 61 6d | 6d 69 6e 67 2f 70 61 72 |/program|ming/par|
|000004b0| 74 33 0a 43 6f 6d 70 2d | 6c 61 6e 67 2d 61 64 61 |t3.Comp-|lang-ada|
|000004c0| 2d 61 72 63 68 69 76 65 | 2d 6e 61 6d 65 3a 20 70 |-archive|-name: p|
|000004d0| 72 6f 67 72 61 6d 6d 69 | 6e 67 2f 70 61 72 74 33 |rogrammi|ng/part3|
|000004e0| 0a 50 6f 73 74 69 6e 67 | 2d 46 72 65 71 75 65 6e |.Posting|-Frequen|
|000004f0| 63 79 3a 20 6d 6f 6e 74 | 68 6c 79 0a 4c 61 73 74 |cy: mont|hly.Last|
|00000500| 2d 6d 6f 64 69 66 69 65 | 64 3a 20 32 38 20 46 65 |-modifie|d: 28 Fe|
|00000510| 62 72 75 61 72 79 20 31 | 39 39 36 0a 4c 61 73 74 |bruary 1|996.Last|
|00000520| 2d 70 6f 73 74 65 64 3a | 20 32 36 20 4a 61 6e 75 |-posted:| 26 Janu|
|00000530| 61 72 79 20 31 39 39 36 | 0a 0a 20 20 20 20 20 20 |ary 1996|.. |
|00000540| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000550| 20 20 20 20 20 20 20 20 | 20 41 64 61 20 50 72 6f | | Ada Pro|
|00000560| 67 72 61 6d 6d 65 72 27 | 73 0a 20 20 20 20 20 20 |grammer'|s. |
|00000570| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000580| 20 46 72 65 71 75 65 6e | 74 6c 79 20 41 73 6b 65 | Frequen|tly Aske|
|00000590| 64 20 51 75 65 73 74 69 | 6f 6e 73 20 28 46 41 51 |d Questi|ons (FAQ|
|000005a0| 29 0a 0a 20 20 20 49 4d | 50 4f 52 54 41 4e 54 20 |).. IM|PORTANT |
|000005b0| 4e 4f 54 45 3a 20 4e 6f | 20 46 41 51 20 63 61 6e |NOTE: No| FAQ can|
|000005c0| 20 73 75 62 73 74 69 74 | 75 74 65 20 66 6f 72 20 | substit|ute for |
|000005d0| 72 65 61 6c 20 74 65 61 | 63 68 69 6e 67 20 61 6e |real tea|ching an|
|000005e0| 64 0a 20 20 20 64 6f 63 | 75 6d 65 6e 74 61 74 69 |d. doc|umentati|
|000005f0| 6f 6e 2e 20 54 68 65 72 | 65 20 69 73 20 61 6e 20 |on. Ther|e is an |
|00000600| 61 6e 6e 6f 74 61 74 65 | 64 20 6c 69 73 74 20 6f |annotate|d list o|
|00000610| 66 20 41 64 61 20 62 6f | 6f 6b 73 20 69 6e 20 74 |f Ada bo|oks in t|
|00000620| 68 65 0a 20 20 20 63 6f | 6d 70 61 6e 69 6f 6e 20 |he. co|mpanion |
|00000630| 63 6f 6d 70 2e 6c 61 6e | 67 2e 61 64 61 20 46 41 |comp.lan|g.ada FA|
|00000640| 51 2e 0a 0a 54 68 69 73 | 20 69 73 20 70 61 72 74 |Q...This| is part|
|00000650| 20 33 20 6f 66 20 61 20 | 34 2d 70 61 72 74 20 70 | 3 of a |4-part p|
|00000660| 6f 73 74 69 6e 67 2e 0a | 50 61 72 74 20 32 20 62 |osting..|Part 2 b|
|00000670| 65 67 69 6e 73 20 77 69 | 74 68 20 71 75 65 73 74 |egins wi|th quest|
|00000680| 69 6f 6e 20 35 2e 0a 50 | 61 72 74 20 34 20 62 65 |ion 5..P|art 4 be|
|00000690| 67 69 6e 73 20 77 69 74 | 68 20 71 75 65 73 74 69 |gins wit|h questi|
|000006a0| 6f 6e 20 39 2e 0a 50 61 | 72 74 73 20 31 20 61 6e |on 9..Pa|rts 1 an|
|000006b0| 64 20 32 20 73 68 6f 75 | 6c 64 20 62 65 20 74 68 |d 2 shou|ld be th|
|000006c0| 65 20 70 72 65 76 69 6f | 75 73 20 70 6f 73 74 69 |e previo|us posti|
|000006d0| 6e 67 73 20 69 6e 20 74 | 68 69 73 20 74 68 72 65 |ngs in t|his thre|
|000006e0| 61 64 2e 0a 50 61 72 74 | 20 34 20 73 68 6f 75 6c |ad..Part| 4 shoul|
|000006f0| 64 20 62 65 20 74 68 65 | 20 6e 65 78 74 20 70 6f |d be the| next po|
|00000700| 73 74 69 6e 67 20 69 6e | 20 74 68 69 73 20 74 68 |sting in| this th|
|00000710| 72 65 61 64 2e 0a 0a 20 | 20 20 20 52 65 63 65 6e |read... | Recen|
|00000720| 74 20 63 68 61 6e 67 65 | 73 20 74 6f 20 74 68 69 |t change|s to thi|
|00000730| 73 20 46 41 51 20 61 72 | 65 20 6c 69 73 74 65 64 |s FAQ ar|e listed|
|00000740| 20 69 6e 20 74 68 65 20 | 66 69 72 73 74 20 73 65 | in the |first se|
|00000750| 63 74 69 6f 6e 20 61 66 | 74 65 72 20 74 68 65 20 |ction af|ter the |
|00000760| 74 61 62 6c 65 0a 20 20 | 20 20 6f 66 20 63 6f 6e |table. | of con|
|00000770| 74 65 6e 74 73 20 28 69 | 6e 20 70 61 72 74 20 31 |tents (i|n part 1|
|00000780| 29 2e 20 54 68 69 73 20 | 64 6f 63 75 6d 65 6e 74 |). This |document|
|00000790| 20 69 73 20 75 6e 64 65 | 72 20 65 78 70 6c 69 63 | is unde|r explic|
|000007a0| 69 74 20 63 6f 70 79 72 | 69 67 68 74 2e 0a 0a 0a |it copyr|ight....|
|000007b0| 36 3a 20 41 64 61 20 4e | 75 6d 65 72 69 63 73 0a |6: Ada N|umerics.|
|000007c0| 0a 36 2e 31 3a 20 57 68 | 65 72 65 20 63 61 6e 20 |.6.1: Wh|ere can |
|000007d0| 49 20 66 69 6e 64 20 61 | 6e 6f 6e 79 6d 6f 75 73 |I find a|nonymous|
|000007e0| 20 66 74 70 20 73 69 74 | 65 73 20 66 6f 72 20 41 | ftp sit|es for A|
|000007f0| 64 61 20 6d 61 74 68 20 | 70 61 63 6b 61 67 65 73 |da math |packages|
|00000800| 3f 20 49 6e 20 70 61 72 | 74 69 63 75 6c 61 72 0a |? In par|ticular.|
|00000810| 77 68 65 72 65 20 61 72 | 65 20 74 68 65 20 72 61 |where ar|e the ra|
|00000820| 6e 64 6f 6d 20 6e 75 6d | 62 65 72 20 67 65 6e 65 |ndom num|ber gene|
|00000830| 72 61 74 6f 72 73 3f 0a | 0a 0a 20 20 20 66 74 70 |rators?.|.. ftp|
|00000840| 2e 72 61 74 69 6f 6e 61 | 6c 2e 63 6f 6d 0a 20 20 |.rationa|l.com. |
|00000850| 20 20 20 20 20 20 20 20 | 46 72 65 65 77 61 72 65 | |Freeware|
|00000860| 20 76 65 72 73 69 6f 6e | 20 6f 66 20 74 68 65 20 | version| of the |
|00000870| 49 53 4f 20 6d 61 74 68 | 20 70 61 63 6b 61 67 65 |ISO math| package|
|00000880| 73 20 6f 6e 20 52 61 74 | 69 6f 6e 61 6c 27 73 20 |s on Rat|ional's |
|00000890| 46 54 50 0a 20 20 20 20 | 20 20 20 20 20 20 73 65 |FTP. | se|
|000008a0| 72 76 65 72 2e 20 49 74 | 27 73 20 61 20 62 69 6e |rver. It|'s a bin|
|000008b0| 64 69 6e 67 20 6f 76 65 | 72 20 74 68 65 20 43 20 |ding ove|r the C |
|000008c0| 4d 61 74 68 20 6c 69 62 | 72 61 72 79 2c 20 69 6e |Math lib|rary, in|
|000008d0| 0a 20 20 20 20 20 20 20 | 20 20 20 70 75 62 6c 69 |. | publi|
|000008e0| 63 2f 61 70 65 78 2f 66 | 72 65 65 77 61 72 65 2f |c/apex/f|reeware/|
|000008f0| 6d 61 74 68 5f 6c 69 62 | 2e 74 61 72 2e 5a 0a 0a |math_lib|.tar.Z..|
|00000900| 20 20 20 61 72 63 68 69 | 6d 65 64 65 73 2e 6e 6f | archi|medes.no|
|00000910| 73 63 2e 6d 69 6c 0a 20 | 20 20 20 20 20 20 20 20 |sc.mil. | |
|00000920| 20 53 74 75 66 66 20 6f | 66 20 68 69 67 68 20 71 | Stuff o|f high q|
|00000930| 75 61 6c 69 74 79 20 69 | 6e 20 70 75 62 2f 61 64 |uality i|n pub/ad|
|00000940| 61 20 54 68 65 20 72 61 | 6e 64 6f 6d 20 6e 75 6d |a The ra|ndom num|
|00000950| 62 65 72 20 67 65 6e 65 | 72 61 74 6f 72 0a 20 20 |ber gene|rator. |
|00000960| 20 20 20 20 20 20 20 20 | 61 6e 64 20 72 61 6e 64 | |and rand|
|00000970| 6f 6d 20 64 65 76 69 61 | 74 65 73 20 61 72 65 20 |om devia|tes are |
|00000980| 72 65 63 6f 6d 6d 65 6e | 64 65 64 2e 20 54 68 65 |recommen|ded. The|
|00000990| 73 65 20 61 72 65 20 6d | 69 72 72 6f 72 65 64 20 |se are m|irrored |
|000009a0| 61 74 20 74 68 65 0a 20 | 20 20 20 20 20 20 20 20 |at the. | |
|000009b0| 20 6e 65 78 74 20 73 69 | 74 65 2c 20 77 75 61 72 | next si|te, wuar|
|000009c0| 63 68 69 76 65 2e 0a 0a | 20 20 20 77 75 61 72 63 |chive...| wuarc|
|000009d0| 68 69 76 65 2e 77 75 73 | 74 6c 2e 65 64 75 0a 20 |hive.wus|tl.edu. |
|000009e0| 20 20 20 20 20 20 20 20 | 20 53 69 74 65 20 6f 66 | | Site of|
|000009f0| 20 50 41 4c 2c 20 74 68 | 65 20 50 75 62 6c 69 63 | PAL, th|e Public|
|00000a00| 20 41 64 61 20 4c 69 62 | 72 61 72 79 3a 20 6d 61 | Ada Lib|rary: ma|
|00000a10| 74 68 20 72 6f 75 74 69 | 6e 65 73 20 73 63 61 74 |th routi|nes scat|
|00000a20| 74 65 72 65 64 0a 20 20 | 20 20 20 20 20 20 20 20 |tered. | |
|00000a30| 61 62 6f 75 74 20 69 6e | 20 74 68 65 20 64 69 72 |about in| the dir|
|00000a40| 65 63 74 6f 72 69 65 73 | 20 75 6e 64 65 72 20 6c |ectories| under l|
|00000a50| 61 6e 67 75 61 67 65 73 | 2f 61 64 61 20 69 6e 20 |anguages|/ada in |
|00000a60| 70 61 72 74 69 63 75 6c | 61 72 2c 20 69 6e 0a 20 |particul|ar, in. |
|00000a70| 20 20 20 20 20 20 20 20 | 20 73 75 62 64 69 72 65 | | subdire|
|00000a80| 63 74 6f 72 79 20 73 77 | 63 6f 6d 70 73 0a 0a 20 |ctory sw|comps.. |
|00000a90| 20 20 73 6f 75 72 63 65 | 2e 61 73 73 65 74 2e 63 | source|.asset.c|
|00000aa0| 6f 6d 0a 20 20 20 20 20 | 20 20 20 20 20 54 68 69 |om. | Thi|
|00000ab0| 73 20 69 73 20 6e 6f 74 | 20 61 6e 20 61 6e 6f 6e |s is not| an anon|
|00000ac0| 79 6d 6f 75 73 20 66 74 | 70 20 73 69 74 65 20 66 |ymous ft|p site f|
|00000ad0| 6f 72 20 6d 61 74 68 20 | 73 6f 66 74 77 61 72 65 |or math |software|
|00000ae0| 2e 20 57 68 61 74 20 79 | 6f 75 0a 20 20 20 20 20 |. What y|ou. |
|00000af0| 20 20 20 20 20 73 68 6f | 75 6c 64 20 64 6f 20 69 | sho|uld do i|
|00000b00| 73 20 6c 6f 67 20 6f 6e | 20 61 6e 6f 6e 79 6d 6f |s log on| anonymo|
|00000b10| 75 73 6c 79 20 75 6e 64 | 65 72 20 66 74 70 2c 20 |usly und|er ftp, |
|00000b20| 61 6e 64 20 64 6f 77 6e | 6c 6f 61 64 20 74 68 65 |and down|load the|
|00000b30| 0a 20 20 20 20 20 20 20 | 20 20 20 66 69 6c 65 20 |. | file |
|00000b40| 61 73 73 65 74 2e 66 61 | 71 20 66 72 6f 6d 20 74 |asset.fa|q from t|
|00000b50| 68 65 20 64 69 72 65 63 | 74 6f 72 79 20 70 75 62 |he direc|tory pub|
|00000b60| 2e 20 54 68 69 73 20 77 | 69 6c 6c 20 74 65 6c 6c |. This w|ill tell|
|00000b70| 20 79 6f 75 20 68 6f 77 | 0a 20 20 20 20 20 20 20 | you how|. |
|00000b80| 20 20 20 74 6f 20 67 65 | 74 20 61 6e 20 61 63 63 | to ge|t an acc|
|00000b90| 6f 75 6e 74 2e 0a 0a 20 | 20 20 66 74 70 2e 63 73 |ount... | ftp.cs|
|00000ba0| 2e 6b 75 6c 65 75 76 65 | 6e 2e 61 63 2e 62 65 0a |.kuleuve|n.ac.be.|
|00000bb0| 20 20 20 20 20 20 20 20 | 20 20 47 6f 20 74 6f 20 | | Go to |
|00000bc0| 64 69 72 65 63 74 6f 72 | 79 20 70 75 62 2f 41 64 |director|y pub/Ad|
|00000bd0| 61 2d 42 65 6c 67 69 75 | 6d 2f 63 64 72 6f 6d 2e |a-Belgiu|m/cdrom.|
|00000be0| 20 54 68 65 72 65 27 73 | 20 61 20 63 6f 6c 6c 65 | There's| a colle|
|00000bf0| 63 74 69 6f 6e 20 6f 66 | 0a 20 20 20 20 20 20 20 |ction of|. |
|00000c00| 20 20 20 6d 61 74 68 20 | 69 6e 74 65 6e 73 69 76 | math |intensiv|
|00000c10| 65 20 73 6f 66 74 77 61 | 72 65 20 69 6e 20 64 69 |e softwa|re in di|
|00000c20| 72 65 63 74 6f 72 79 20 | 73 77 63 6f 6d 70 73 2e |rectory |swcomps.|
|00000c30| 20 4d 69 72 72 6f 72 73 | 20 73 6f 6d 65 20 6f 66 | Mirrors| some of|
|00000c40| 0a 20 20 20 20 20 20 20 | 20 20 20 50 41 4c 20 61 |. | PAL a|
|00000c50| 74 20 77 75 61 72 63 68 | 69 76 65 2e 77 75 73 74 |t wuarch|ive.wust|
|00000c60| 6c 2e 65 64 75 2e 0a 0a | 20 20 20 73 77 2d 65 6e |l.edu...| sw-en|
|00000c70| 67 2e 66 61 6c 6c 73 2d | 63 68 75 72 63 68 2e 76 |g.falls-|church.v|
|00000c80| 61 2e 75 73 0a 20 20 20 | 20 20 20 20 20 20 20 47 |a.us. | G|
|00000c90| 6f 20 74 6f 20 64 69 72 | 65 63 74 6f 72 79 20 70 |o to dir|ectory p|
|00000ca0| 75 62 6c 69 63 2f 41 64 | 61 49 43 2f 73 6f 75 72 |ublic/Ad|aIC/sour|
|00000cb0| 63 65 2d 63 6f 64 65 2f | 62 69 6e 64 69 6e 67 73 |ce-code/|bindings|
|00000cc0| 2f 41 44 41 52 2d 62 69 | 6e 64 69 6e 67 73 0a 20 |/ADAR-bi|ndings. |
|00000cd0| 20 20 20 20 20 20 20 20 | 20 74 6f 20 66 69 6e 64 | | to find|
|00000ce0| 20 65 78 74 65 6e 64 65 | 64 2d 70 72 65 63 69 73 | extende|d-precis|
|00000cf0| 69 6f 6e 20 64 65 63 69 | 6d 61 6c 20 61 72 69 74 |ion deci|mal arit|
|00000d00| 68 6d 65 74 69 63 20 28 | 75 70 20 74 6f 20 31 38 |hmetic (|up to 18|
|00000d10| 0a 20 20 20 20 20 20 20 | 20 20 20 64 69 67 69 74 |. | digit|
|00000d20| 73 29 2e 20 49 6e 63 6c | 75 64 65 73 20 66 61 63 |s). Incl|udes fac|
|00000d30| 69 6c 69 74 69 65 73 20 | 66 6f 72 20 43 4f 42 4f |ilities |for COBO|
|00000d40| 4c 2d 6c 69 6b 65 20 66 | 6f 72 6d 61 74 74 65 64 |L-like f|ormatted|
|00000d50| 20 6f 75 74 70 75 74 2e | 0a 0a 0a 36 2e 32 3a 20 | output.|...6.2: |
|00000d60| 48 6f 77 20 63 61 6e 20 | 49 20 77 72 69 74 65 20 |How can |I write |
|00000d70| 70 6f 72 74 61 62 6c 65 | 20 63 6f 64 65 20 69 6e |portable| code in|
|00000d80| 20 41 64 61 20 38 33 20 | 75 73 69 6e 67 20 70 72 | Ada 83 |using pr|
|00000d90| 65 64 65 66 69 6e 65 64 | 20 74 79 70 65 73 20 6c |edefined| types l|
|00000da0| 69 6b 65 20 46 6c 6f 61 | 74 0a 61 6e 64 20 4c 6f |ike Floa|t.and Lo|
|00000db0| 6e 67 5f 46 6c 6f 61 74 | 3f 20 4c 69 6b 65 77 69 |ng_Float|? Likewi|
|00000dc0| 73 65 2c 20 68 6f 77 20 | 63 61 6e 20 49 20 77 72 |se, how |can I wr|
|00000dd0| 69 74 65 20 70 6f 72 74 | 61 62 6c 65 20 63 6f 64 |ite port|able cod|
|00000de0| 65 20 74 68 61 74 20 75 | 73 65 73 20 4d 61 74 68 |e that u|ses Math|
|00000df0| 0a 66 75 6e 63 74 69 6f | 6e 73 20 6c 69 6b 65 20 |.functio|ns like |
|00000e00| 53 69 6e 20 61 6e 64 20 | 4c 6f 67 20 74 68 61 74 |Sin and |Log that|
|00000e10| 20 61 72 65 20 64 65 66 | 69 6e 65 64 20 66 6f 72 | are def|ined for|
|00000e20| 20 46 6c 6f 61 74 20 61 | 6e 64 20 4c 6f 6e 67 5f | Float a|nd Long_|
|00000e30| 46 6c 6f 61 74 3f 0a 0a | 20 20 20 28 66 72 6f 6d |Float?..| (from|
|00000e40| 20 4a 6f 6e 61 74 68 61 | 6e 20 50 61 72 6b 65 72 | Jonatha|n Parker|
|00000e50| 29 0a 0a 20 20 20 41 64 | 61 20 38 33 20 77 61 73 |).. Ad|a 83 was|
|00000e60| 20 73 6c 6f 77 20 74 6f | 20 61 72 72 69 76 65 20 | slow to| arrive |
|00000e70| 61 74 20 61 20 73 74 61 | 6e 64 61 72 64 20 6e 61 |at a sta|ndard na|
|00000e80| 6d 69 6e 67 20 63 6f 6e | 76 65 6e 74 69 6f 6e 20 |ming con|vention |
|00000e90| 66 6f 72 0a 20 20 20 65 | 6c 65 6d 65 6e 74 61 72 |for. e|lementar|
|00000ea0| 79 20 6d 61 74 68 20 66 | 75 6e 63 74 69 6f 6e 73 |y math f|unctions|
|00000eb0| 20 61 6e 64 20 63 6f 6d | 70 6c 65 78 20 6e 75 6d | and com|plex num|
|00000ec0| 62 65 72 73 2e 20 46 75 | 72 74 68 65 72 6d 6f 72 |bers. Fu|rthermor|
|00000ed0| 65 2c 20 79 6f 75 27 6c | 6c 0a 20 20 20 66 69 6e |e, you'l|l. fin|
|00000ee0| 64 20 74 68 61 74 20 73 | 6f 6d 65 20 63 6f 6d 70 |d that s|ome comp|
|00000ef0| 69 6c 65 72 73 20 63 61 | 6c 6c 20 74 68 65 20 36 |ilers ca|ll the 6|
|00000f00| 34 2d 62 69 74 20 66 6c | 6f 61 74 69 6e 67 20 70 |4-bit fl|oating p|
|00000f10| 6f 69 6e 74 20 74 79 70 | 65 0a 20 20 20 4c 6f 6e |oint typ|e. Lon|
|00000f20| 67 5f 46 6c 6f 61 74 3b | 20 6f 74 68 65 72 20 63 |g_Float;| other c|
|00000f30| 6f 6d 70 69 6c 65 72 73 | 20 63 61 6c 6c 20 69 74 |ompilers| call it|
|00000f40| 20 46 6c 6f 61 74 2e 20 | 46 6f 72 74 75 6e 61 74 | Float. |Fortunat|
|00000f50| 65 6c 79 2c 20 69 74 20 | 69 73 20 65 61 73 79 20 |ely, it |is easy |
|00000f60| 74 6f 0a 20 20 20 77 72 | 69 74 65 20 70 72 6f 67 |to. wr|ite prog|
|00000f70| 72 61 6d 73 20 69 6e 20 | 41 64 61 20 74 68 61 74 |rams in |Ada that|
|00000f80| 20 61 72 65 20 69 6e 64 | 65 70 65 6e 64 65 6e 74 | are ind|ependent|
|00000f90| 20 6f 66 20 74 68 65 20 | 6e 61 6d 69 6e 67 20 63 | of the |naming c|
|00000fa0| 6f 6e 76 65 6e 74 69 6f | 6e 73 0a 20 20 20 66 6f |onventio|ns. fo|
|00000fb0| 72 20 66 6c 6f 61 74 69 | 6e 67 20 70 6f 69 6e 74 |r floati|ng point|
|00000fc0| 20 74 79 70 65 73 20 61 | 6e 64 20 69 6e 64 65 70 | types a|nd indep|
|00000fd0| 65 6e 64 65 6e 74 20 6f | 66 20 74 68 65 20 6e 61 |endent o|f the na|
|00000fe0| 6d 69 6e 67 20 63 6f 6e | 76 65 6e 74 69 6f 6e 73 |ming con|ventions|
|00000ff0| 20 6f 66 0a 20 20 20 6d | 61 74 68 20 66 75 6e 63 | of. m|ath func|
|00001000| 74 69 6f 6e 73 20 64 65 | 66 69 6e 65 64 20 6f 6e |tions de|fined on|
|00001010| 20 74 68 6f 73 65 20 74 | 79 70 65 73 2e 0a 0a 20 | those t|ypes... |
|00001020| 20 20 4f 6e 65 20 6f 66 | 20 74 68 65 20 63 6c 65 | One of| the cle|
|00001030| 61 6e 65 73 74 20 77 61 | 79 73 20 69 73 20 74 6f |anest wa|ys is to|
|00001040| 20 6d 61 6b 65 20 74 68 | 65 20 70 72 6f 67 72 61 | make th|e progra|
|00001050| 6d 20 67 65 6e 65 72 69 | 63 3a 0a 0a 20 20 20 20 |m generi|c:.. |
|00001060| 20 67 65 6e 65 72 69 63 | 0a 20 20 20 20 20 20 20 | generic|. |
|00001070| 74 79 70 65 20 52 65 61 | 6c 20 69 73 20 64 69 67 |type Rea|l is dig|
|00001080| 69 74 73 20 3c 3e 3b 0a | 20 20 20 20 20 20 20 77 |its <>;.| w|
|00001090| 69 74 68 20 66 75 6e 63 | 74 69 6f 6e 20 41 72 63 |ith func|tion Arc|
|000010a0| 73 69 6e 20 28 58 20 3a | 20 52 65 61 6c 29 20 72 |sin (X :| Real) r|
|000010b0| 65 74 75 72 6e 20 52 65 | 61 6c 20 69 73 20 3c 3e |eturn Re|al is <>|
|000010c0| 3b 0a 20 20 20 20 20 20 | 20 77 69 74 68 20 66 75 |;. | with fu|
|000010d0| 6e 63 74 69 6f 6e 20 20 | 20 20 4c 6f 67 20 28 58 |nction | Log (X|
|000010e0| 20 3a 20 52 65 61 6c 29 | 20 72 65 74 75 72 6e 20 | : Real)| return |
|000010f0| 52 65 61 6c 20 69 73 20 | 3c 3e 3b 0a 20 20 20 20 |Real is |<>;. |
|00001100| 20 20 20 2d 2d 20 20 54 | 68 69 73 20 69 73 20 74 | -- T|his is t|
|00001110| 68 65 20 6e 61 74 75 72 | 61 6c 20 6c 6f 67 2c 20 |he natur|al log, |
|00001120| 69 6e 76 65 72 73 65 20 | 6f 66 20 45 78 70 28 58 |inverse |of Exp(X|
|00001130| 29 2c 20 73 6f 6d 65 74 | 69 6d 65 73 20 77 72 69 |), somet|imes wri|
|00001140| 74 74 65 6e 20 4c 6e 28 | 58 29 2e 0a 20 20 20 20 |tten Ln(|X).. |
|00001150| 20 70 61 63 6b 61 67 65 | 20 45 78 61 6d 70 6c 65 | package| Example|
|00001160| 5f 31 20 69 73 0a 20 20 | 20 20 20 20 20 2e 2e 2e |_1 is. | ...|
|00001170| 0a 20 20 20 20 20 65 6e | 64 20 45 78 61 6d 70 6c |. en|d Exampl|
|00001180| 65 5f 31 3b 0a 0a 0a 20 | 20 20 53 6f 20 74 68 65 |e_1;... | So the|
|00001190| 20 61 62 6f 76 65 20 70 | 61 63 6b 61 67 65 20 64 | above p|ackage d|
|000011a0| 6f 65 73 6e 27 74 20 63 | 61 72 65 20 77 68 61 74 |oesn't c|are what|
|000011b0| 20 74 68 65 20 6e 61 6d | 65 20 6f 66 20 74 68 65 | the nam|e of the|
|000011c0| 20 66 6c 6f 61 74 69 6e | 67 20 70 6f 69 6e 74 0a | floatin|g point.|
|000011d0| 20 20 20 74 79 70 65 20 | 69 73 2c 20 6f 72 20 77 | type |is, or w|
|000011e0| 68 61 74 20 70 61 63 6b | 61 67 65 20 74 68 65 20 |hat pack|age the |
|000011f0| 4d 61 74 68 20 66 75 6e | 63 74 69 6f 6e 73 20 61 |Math fun|ctions a|
|00001200| 72 65 20 64 65 66 69 6e | 65 64 20 69 6e 2c 20 6a |re defin|ed in, j|
|00001210| 75 73 74 20 61 73 0a 20 | 20 20 6c 6f 6e 67 20 61 |ust as. | long a|
|00001220| 73 20 74 68 65 20 66 6c | 6f 61 74 69 6e 67 20 70 |s the fl|oating p|
|00001230| 6f 69 6e 74 20 74 79 70 | 65 20 68 61 73 20 74 68 |oint typ|e has th|
|00001240| 65 20 72 69 67 68 74 20 | 61 74 74 72 69 62 75 74 |e right |attribut|
|00001250| 65 73 20 28 70 72 65 63 | 69 73 69 6f 6e 0a 20 20 |es (prec|ision. |
|00001260| 20 61 6e 64 20 72 61 6e | 67 65 29 20 66 6f 72 20 | and ran|ge) for |
|00001270| 74 68 65 20 61 6c 67 6f | 72 69 74 68 6d 2c 20 61 |the algo|rithm, a|
|00001280| 6e 64 20 6c 69 6b 65 77 | 69 73 65 20 74 68 65 20 |nd likew|ise the |
|00001290| 66 75 6e 63 74 69 6f 6e | 73 2e 20 45 76 65 72 79 |function|s. Every|
|000012a0| 74 68 69 6e 67 0a 20 20 | 20 69 6e 20 74 68 65 20 |thing. | in the |
|000012b0| 62 6f 64 79 20 6f 66 20 | 45 78 61 6d 70 6c 65 5f |body of |Example_|
|000012c0| 31 20 69 73 20 77 72 69 | 74 74 65 6e 20 69 6e 20 |1 is wri|tten in |
|000012d0| 74 65 72 6d 73 20 6f 66 | 20 74 68 65 20 61 62 73 |terms of| the abs|
|000012e0| 74 72 61 63 74 20 6e 61 | 6d 65 73 2c 0a 20 20 20 |tract na|mes,. |
|000012f0| 52 65 61 6c 2c 20 41 72 | 63 73 69 6e 2c 20 61 6e |Real, Ar|csin, an|
|00001300| 64 20 4c 6f 67 2c 20 65 | 76 65 6e 20 74 68 6f 75 |d Log, e|ven thou|
|00001310| 67 68 20 79 6f 75 20 69 | 6e 73 74 61 6e 74 69 61 |gh you i|nstantia|
|00001320| 74 65 20 69 74 20 77 69 | 74 68 20 63 6f 6d 70 69 |te it wi|th compi|
|00001330| 6c 65 72 0a 20 20 20 73 | 70 65 63 69 66 69 63 20 |ler. s|pecific |
|00001340| 6e 61 6d 65 73 20 74 68 | 61 74 20 63 61 6e 20 6c |names th|at can l|
|00001350| 6f 6f 6b 20 76 65 72 79 | 20 64 69 66 66 65 72 65 |ook very| differe|
|00001360| 6e 74 3a 0a 0a 20 20 20 | 20 20 20 70 61 63 6b 61 |nt:.. | packa|
|00001370| 67 65 20 53 70 65 63 69 | 61 6c 5f 43 61 73 65 20 |ge Speci|al_Case |
|00001380| 69 73 20 6e 65 77 20 45 | 78 61 6d 70 6c 65 5f 31 |is new E|xample_1|
|00001390| 20 28 4c 6f 6e 67 5f 46 | 6c 6f 61 74 2c 20 41 73 | (Long_F|loat, As|
|000013a0| 69 6e 2c 20 4c 6e 29 3b | 0a 0a 0a 20 20 20 54 68 |in, Ln);|... Th|
|000013b0| 65 20 6e 75 6d 65 72 69 | 63 61 6c 20 61 6c 67 6f |e numeri|cal algo|
|000013c0| 72 69 74 68 6d 73 20 69 | 6d 70 6c 65 6d 65 6e 74 |rithms i|mplement|
|000013d0| 65 64 20 62 79 20 67 65 | 6e 65 72 69 63 73 20 6c |ed by ge|nerics l|
|000013e0| 69 6b 65 20 45 78 61 6d | 70 6c 65 5f 31 20 63 61 |ike Exam|ple_1 ca|
|000013f0| 6e 0a 20 20 20 75 73 75 | 61 6c 6c 79 20 62 65 20 |n. usu|ally be |
|00001400| 6d 61 64 65 20 74 6f 20 | 77 6f 72 6b 20 66 6f 72 |made to |work for|
|00001410| 20 61 20 72 61 6e 67 65 | 20 6f 66 20 66 6c 6f 61 | a range| of floa|
|00001420| 74 69 6e 67 20 70 6f 69 | 6e 74 20 70 72 65 63 69 |ting poi|nt preci|
|00001430| 73 69 6f 6e 73 2e 20 41 | 0a 20 20 20 77 65 6c 6c |sions. A|. well|
|00001440| 20 77 72 69 74 74 65 6e | 20 70 72 6f 67 72 61 6d | written| program|
|00001450| 20 77 69 6c 6c 20 70 65 | 72 66 6f 72 6d 20 74 65 | will pe|rform te|
|00001460| 73 74 73 20 6f 6e 20 52 | 65 61 6c 20 74 6f 20 72 |sts on R|eal to r|
|00001470| 65 6a 65 63 74 0a 20 20 | 20 69 6e 73 74 61 6e 74 |eject. | instant|
|00001480| 69 61 74 69 6f 6e 73 20 | 6f 66 20 45 78 61 6d 70 |iations |of Examp|
|00001490| 6c 65 5f 31 20 69 66 20 | 74 68 65 20 66 6c 6f 61 |le_1 if |the floa|
|000014a0| 74 69 6e 67 20 70 6f 69 | 6e 74 73 20 74 79 70 65 |ting poi|nts type|
|000014b0| 20 69 73 20 6a 75 64 67 | 65 64 0a 20 20 20 69 6e | is judg|ed. in|
|000014c0| 61 64 65 71 75 61 74 65 | 2e 20 54 68 65 20 74 65 |adequate|. The te|
|000014d0| 73 74 73 20 6d 61 79 20 | 63 68 65 63 6b 20 74 68 |sts may |check th|
|000014e0| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 64 69 67 69 |e number| of digi|
|000014f0| 74 73 20 6f 66 20 70 72 | 65 63 69 73 69 6f 6e 20 |ts of pr|ecision |
|00001500| 69 6e 0a 20 20 20 52 65 | 61 6c 20 28 52 65 61 6c |in. Re|al (Real|
|00001510| 27 44 69 67 69 74 73 29 | 20 6f 72 20 74 68 65 20 |'Digits)| or the |
|00001520| 72 61 6e 67 65 20 6f 66 | 20 52 65 61 6c 20 28 52 |range of| Real (R|
|00001530| 65 61 6c 27 46 69 72 73 | 74 2c 20 52 65 61 6c 27 |eal'Firs|t, Real'|
|00001540| 4c 61 73 74 29 20 6f 72 | 20 74 68 65 0a 20 20 20 |Last) or| the. |
|00001550| 6c 61 72 67 65 73 74 20 | 65 78 70 6f 6e 65 6e 74 |largest |exponent|
|00001560| 20 6f 66 20 74 68 65 20 | 73 65 74 20 6f 66 20 73 | of the |set of s|
|00001570| 61 66 65 20 6e 75 6d 62 | 65 72 73 20 28 52 65 61 |afe numb|ers (Rea|
|00001580| 6c 27 53 61 66 65 5f 45 | 6d 61 78 29 2c 20 65 74 |l'Safe_E|max), et|
|00001590| 63 2e 0a 20 20 20 54 68 | 65 73 65 20 74 65 73 74 |c.. Th|ese test|
|000015a0| 73 20 61 72 65 20 6f 66 | 74 65 6e 20 70 6c 61 63 |s are of|ten plac|
|000015b0| 65 64 20 61 66 74 65 72 | 20 74 68 65 20 62 65 67 |ed after| the beg|
|000015c0| 69 6e 20 73 74 61 74 65 | 6d 65 6e 74 20 6f 66 20 |in state|ment of |
|000015d0| 70 61 63 6b 61 67 65 0a | 20 20 20 62 6f 64 79 2c |package.| body,|
|000015e0| 20 61 73 20 69 6e 3a 0a | 0a 20 20 20 20 20 70 61 | as in:.|. pa|
|000015f0| 63 6b 61 67 65 20 62 6f | 64 79 20 45 78 61 6d 70 |ckage bo|dy Examp|
|00001600| 6c 65 5f 31 20 69 73 0a | 20 20 20 20 20 20 20 2e |le_1 is.| .|
|00001610| 2e 2e 0a 20 20 20 20 20 | 62 65 67 69 6e 0a 20 20 |... |begin. |
|00001620| 20 20 20 20 20 69 66 20 | 28 52 65 61 6c 27 4d 61 | if |(Real'Ma|
|00001630| 63 68 69 6e 65 5f 4d 61 | 6e 74 69 73 73 61 20 3e |chine_Ma|ntissa >|
|00001640| 20 36 30 29 20 6f 72 20 | 28 52 65 61 6c 27 4d 61 | 60) or |(Real'Ma|
|00001650| 63 68 69 6e 65 5f 45 6d | 61 78 20 3c 20 32 35 36 |chine_Em|ax < 256|
|00001660| 29 20 74 68 65 6e 0a 20 | 20 20 20 20 20 20 20 20 |) then. | |
|00001670| 72 61 69 73 65 20 50 72 | 6f 67 72 61 6d 5f 45 72 |raise Pr|ogram_Er|
|00001680| 72 6f 72 3b 0a 20 20 20 | 20 20 20 20 65 6e 64 20 |ror;. | end |
|00001690| 69 66 3b 0a 20 20 20 20 | 20 65 6e 64 20 45 78 61 |if;. | end Exa|
|000016a0| 6d 70 6c 65 5f 31 3b 0a | 0a 0a 20 20 20 4d 61 6b |mple_1;.|.. Mak|
|000016b0| 69 6e 67 20 61 6e 20 61 | 6c 67 6f 72 69 74 68 6d |ing an a|lgorithm|
|000016c0| 20 61 73 20 61 62 73 74 | 72 61 63 74 20 61 73 20 | as abst|ract as |
|000016d0| 70 6f 73 73 69 62 6c 65 | 2c 20 28 69 6e 64 65 70 |possible|, (indep|
|000016e0| 65 6e 64 65 6e 74 20 6f | 66 20 64 61 74 61 0a 20 |endent o|f data. |
|000016f0| 20 20 74 79 70 65 73 20 | 61 73 20 6d 75 63 68 20 | types |as much |
|00001700| 61 73 20 70 6f 73 73 69 | 62 6c 65 29 20 63 61 6e |as possi|ble) can|
|00001710| 20 64 6f 20 61 20 6c 6f | 74 20 74 6f 20 69 6d 70 | do a lo|t to imp|
|00001720| 72 6f 76 65 20 74 68 65 | 20 71 75 61 6c 69 74 79 |rove the| quality|
|00001730| 20 6f 66 20 74 68 65 0a | 20 20 20 63 6f 64 65 2e | of the.| code.|
|00001740| 20 53 75 70 70 6f 72 74 | 20 66 6f 72 20 61 62 73 | Support| for abs|
|00001750| 74 72 61 63 74 69 6f 6e | 20 69 73 20 6f 6e 65 20 |traction| is one |
|00001760| 6f 66 20 74 68 65 20 6d | 61 6e 79 20 74 68 69 6e |of the m|any thin|
|00001770| 67 73 20 41 64 61 2d 70 | 68 69 6c 65 73 0a 20 20 |gs Ada-p|hiles. |
|00001780| 20 66 69 6e 64 20 73 6f | 20 61 74 74 72 61 63 74 | find so| attract|
|00001790| 69 76 65 20 61 62 6f 75 | 74 20 74 68 65 20 6c 61 |ive abou|t the la|
|000017a0| 6e 67 75 61 67 65 2e 20 | 54 68 65 20 64 65 73 69 |nguage. |The desi|
|000017b0| 67 6e 65 72 73 20 6f 66 | 20 41 64 61 20 39 35 0a |gners of| Ada 95.|
|000017c0| 20 20 20 72 65 63 6f 67 | 6e 69 7a 65 64 20 74 68 | recog|nized th|
|000017d0| 65 20 76 61 6c 75 65 20 | 6f 66 20 61 62 73 74 72 |e value |of abstr|
|000017e0| 61 63 74 69 6f 6e 20 69 | 6e 20 74 68 65 20 64 65 |action i|n the de|
|000017f0| 73 69 67 6e 20 6f 66 20 | 6e 75 6d 65 72 69 63 0a |sign of |numeric.|
|00001800| 20 20 20 61 6c 67 6f 72 | 69 74 68 6d 73 20 61 6e | algor|ithms an|
|00001810| 64 20 68 61 76 65 20 67 | 65 6e 65 72 61 6c 69 7a |d have g|eneraliz|
|00001820| 65 64 20 6d 61 6e 79 20 | 6f 66 20 74 68 65 20 66 |ed many |of the f|
|00001830| 65 61 74 75 72 65 73 20 | 6f 66 20 74 68 65 20 27 |eatures |of the '|
|00001840| 38 33 20 6d 6f 64 65 6c | 2e 0a 20 20 20 46 6f 72 |83 model|.. For|
|00001850| 20 65 78 61 6d 70 6c 65 | 2c 20 6e 6f 20 6d 61 74 | example|, no mat|
|00001860| 74 65 72 20 77 68 61 74 | 20 66 6c 6f 61 74 69 6e |ter what| floatin|
|00001870| 67 20 70 6f 69 6e 74 20 | 74 79 70 65 20 79 6f 75 |g point |type you|
|00001880| 20 69 6e 73 74 61 6e 74 | 69 61 74 65 0a 20 20 20 | instant|iate. |
|00001890| 45 78 61 6d 70 6c 65 5f | 31 20 77 69 74 68 2c 20 |Example_|1 with, |
|000018a0| 41 64 61 20 39 35 20 70 | 72 6f 76 69 64 65 73 20 |Ada 95 p|rovides |
|000018b0| 79 6f 75 20 77 69 74 68 | 20 66 75 6e 63 74 69 6f |you with| functio|
|000018c0| 6e 73 20 66 6f 72 20 65 | 78 61 6d 69 6e 69 6e 67 |ns for e|xamining|
|000018d0| 20 74 68 65 0a 20 20 20 | 65 78 70 6f 6e 65 6e 74 | the. |exponent|
|000018e0| 20 61 6e 64 20 74 68 65 | 20 6d 61 6e 74 69 73 73 | and the| mantiss|
|000018f0| 61 73 20 6f 66 20 74 68 | 65 20 6e 75 6d 62 65 72 |as of th|e number|
|00001900| 73 2c 20 66 6f 72 20 74 | 72 75 6e 63 61 74 69 6e |s, for t|runcatin|
|00001910| 67 2c 20 64 65 74 65 72 | 6d 69 6e 69 6e 67 0a 20 |g, deter|mining. |
|00001920| 20 20 65 78 61 63 74 20 | 72 65 6d 61 69 6e 64 65 | exact |remainde|
|00001930| 72 73 2c 20 73 63 61 6c | 69 6e 67 20 65 78 70 6f |rs, scal|ing expo|
|00001940| 6e 65 6e 74 73 2c 20 61 | 6e 64 20 73 6f 20 6f 6e |nents, a|nd so on|
|00001950| 2e 20 28 49 6e 20 74 68 | 65 20 62 6f 64 79 20 6f |. (In th|e body o|
|00001960| 66 0a 20 20 20 45 78 61 | 6d 70 6c 65 5f 31 2c 20 |f. Exa|mple_1, |
|00001970| 61 6e 64 20 69 6e 20 69 | 74 73 20 73 70 65 63 20 |and in i|ts spec |
|00001980| 61 6c 73 6f 20 6f 66 20 | 63 6f 75 72 73 65 2c 20 |also of |course, |
|00001990| 74 68 65 73 65 20 66 75 | 6e 63 74 69 6f 6e 73 20 |these fu|nctions |
|000019a0| 61 72 65 0a 20 20 20 77 | 72 69 74 74 65 6e 2c 20 |are. w|ritten, |
|000019b0| 72 65 73 70 65 63 74 69 | 76 65 6c 79 3a 20 52 65 |respecti|vely: Re|
|000019c0| 61 6c 27 45 78 70 6f 6e | 65 6e 74 28 58 29 2c 20 |al'Expon|ent(X), |
|000019d0| 52 65 61 6c 27 46 72 61 | 63 74 69 6f 6e 28 58 29 |Real'Fra|ction(X)|
|000019e0| 2c 0a 20 20 20 52 65 61 | 6c 27 54 72 75 6e 63 61 |,. Rea|l'Trunca|
|000019f0| 74 69 6f 6e 28 58 29 2c | 20 52 65 61 6c 27 52 65 |tion(X),| Real'Re|
|00001a00| 6d 61 69 6e 64 65 72 28 | 58 2c 59 29 2c 20 52 65 |mainder(|X,Y), Re|
|00001a10| 61 6c 27 53 63 61 6c 69 | 6e 67 28 58 2c 20 4e 29 |al'Scali|ng(X, N)|
|00001a20| 2e 20 54 68 65 72 65 20 | 61 72 65 0a 20 20 20 6f |. There |are. o|
|00001a30| 74 68 65 72 73 2e 29 20 | 41 6c 73 6f 2c 20 69 6e |thers.) |Also, in|
|00001a40| 20 70 61 63 6b 61 67 65 | 20 45 78 61 6d 70 6c 65 | package| Example|
|00001a50| 5f 31 2c 20 41 64 61 20 | 39 35 20 6c 65 74 73 20 |_1, Ada |95 lets |
|00001a60| 79 6f 75 20 64 6f 20 74 | 68 65 20 61 72 69 74 68 |you do t|he arith|
|00001a70| 6d 65 74 69 63 0a 20 20 | 20 6f 6e 20 74 68 65 20 |metic. | on the |
|00001a80| 62 61 73 65 20 74 79 70 | 65 20 6f 66 20 52 65 61 |base typ|e of Rea|
|00001a90| 6c 20 28 63 61 6c 6c 65 | 64 20 52 65 61 6c 27 42 |l (calle|d Real'B|
|00001aa0| 61 73 65 29 20 77 68 69 | 63 68 20 69 73 20 6c 69 |ase) whi|ch is li|
|00001ab0| 61 62 6c 65 20 74 6f 20 | 68 61 76 65 0a 20 20 20 |able to |have. |
|00001ac0| 67 72 65 61 74 65 72 20 | 70 72 65 63 69 73 69 6f |greater |precisio|
|00001ad0| 6e 20 61 6e 64 20 72 61 | 6e 67 65 20 74 68 61 6e |n and ra|nge than|
|00001ae0| 20 74 79 70 65 20 52 65 | 61 6c 2e 0a 0a 20 20 20 | type Re|al... |
|00001af0| 49 74 20 69 73 20 72 61 | 72 65 20 74 6f 20 73 65 |It is ra|re to se|
|00001b00| 65 20 61 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 20 |e a perf|ormance |
|00001b10| 6c 6f 73 73 20 77 68 65 | 6e 20 75 73 69 6e 67 20 |loss whe|n using |
|00001b20| 67 65 6e 65 72 69 63 73 | 20 6c 69 6b 65 20 74 68 |generics| like th|
|00001b30| 69 73 2e 0a 20 20 20 48 | 6f 77 65 76 65 72 2c 20 |is.. H|owever, |
|00001b40| 69 66 20 74 68 65 72 65 | 20 69 73 20 61 6e 20 75 |if there| is an u|
|00001b50| 6e 61 63 63 65 70 74 61 | 62 6c 65 20 70 65 72 66 |naccepta|ble perf|
|00001b60| 6f 72 6d 61 6e 63 65 20 | 68 69 74 2c 20 6f 72 20 |ormance |hit, or |
|00001b70| 69 66 20 67 65 6e 65 72 | 69 63 73 0a 20 20 20 63 |if gener|ics. c|
|00001b80| 61 6e 6e 6f 74 20 62 65 | 20 75 73 65 64 20 66 6f |annot be| used fo|
|00001b90| 72 20 73 6f 6d 65 20 6f | 74 68 65 72 20 72 65 61 |r some o|ther rea|
|00001ba0| 73 6f 6e 2c 20 74 68 65 | 6e 20 73 75 62 74 79 70 |son, the|n subtyp|
|00001bb0| 69 6e 67 20 61 6e 64 20 | 72 65 6e 61 6d 69 6e 67 |ing and |renaming|
|00001bc0| 20 77 69 6c 6c 0a 20 20 | 20 64 6f 20 74 68 65 20 | will. | do the |
|00001bd0| 6a 6f 62 2e 20 48 65 72 | 65 20 69 73 20 61 6e 20 |job. Her|e is an |
|00001be0| 65 78 61 6d 70 6c 65 20 | 6f 66 20 72 65 6e 61 6d |example |of renam|
|00001bf0| 69 6e 67 3a 0a 0a 20 20 | 20 20 20 77 69 74 68 20 |ing:.. | with |
|00001c00| 53 6f 6d 65 6f 6e 65 73 | 5f 4d 61 74 68 5f 4c 69 |Someones|_Math_Li|
|00001c10| 62 3b 0a 20 20 20 20 20 | 70 72 6f 63 65 64 75 72 |b;. |procedur|
|00001c20| 65 20 45 78 61 6d 70 6c | 65 5f 32 20 69 73 0a 0a |e Exampl|e_2 is..|
|00001c30| 20 20 20 20 20 20 20 73 | 75 62 74 79 70 65 20 52 | s|ubtype R|
|00001c40| 65 61 6c 20 69 73 20 4c | 6f 6e 67 5f 46 6c 6f 61 |eal is L|ong_Floa|
|00001c50| 74 3b 0a 0a 20 20 20 20 | 20 20 20 70 61 63 6b 61 |t;.. | packa|
|00001c60| 67 65 20 20 4d 61 74 68 | 20 72 65 6e 61 6d 65 73 |ge Math| renames|
|00001c70| 20 53 6f 6d 65 6f 6e 65 | 73 5f 4d 61 74 68 5f 4c | Someone|s_Math_L|
|00001c80| 69 62 3b 0a 20 20 20 20 | 20 20 20 66 75 6e 63 74 |ib;. | funct|
|00001c90| 69 6f 6e 20 41 72 63 73 | 69 6e 28 58 20 3a 20 52 |ion Arcs|in(X : R|
|00001ca0| 65 61 6c 29 20 72 65 74 | 75 72 6e 20 52 65 61 6c |eal) ret|urn Real|
|00001cb0| 20 72 65 6e 61 6d 65 73 | 20 4d 61 74 68 2e 41 73 | renames| Math.As|
|00001cc0| 69 6e 0a 20 20 20 20 20 | 20 20 66 75 6e 63 74 69 |in. | functi|
|00001cd0| 6f 6e 20 20 20 4c 6f 67 | 20 28 58 20 3a 20 52 65 |on Log| (X : Re|
|00001ce0| 61 6c 29 20 72 65 74 75 | 72 6e 20 52 65 61 6c 20 |al) retu|rn Real |
|00001cf0| 72 65 6e 61 6d 65 73 20 | 4d 61 74 68 2e 20 20 4c |renames |Math. L|
|00001d00| 6e 3b 0a 0a 20 20 20 20 | 20 20 20 2d 2d 20 20 45 |n;.. | -- E|
|00001d10| 76 65 72 79 74 68 69 6e | 67 20 62 65 79 6f 6e 64 |verythin|g beyond|
|00001d20| 20 74 68 69 73 20 70 6f | 69 6e 74 20 69 73 20 61 | this po|int is a|
|00001d30| 62 73 74 72 61 63 74 20 | 77 69 74 68 20 72 65 73 |bstract |with res|
|00001d40| 70 65 63 74 20 74 6f 0a | 20 20 20 20 20 20 20 2d |pect to.| -|
|00001d50| 2d 20 20 74 68 65 20 6e | 61 6d 65 73 20 6f 66 20 |- the n|ames of |
|00001d60| 74 68 65 20 66 6c 6f 61 | 74 69 6e 67 20 70 6f 69 |the floa|ting poi|
|00001d70| 6e 74 20 28 52 65 61 6c | 29 2c 20 74 68 65 20 66 |nt (Real|), the f|
|00001d80| 75 6e 63 74 69 6f 6e 73 | 20 28 41 72 63 73 69 6e |unctions| (Arcsin|
|00001d90| 0a 20 20 20 20 20 20 20 | 2d 2d 20 20 61 6e 64 20 |. |-- and |
|00001da0| 4c 6f 67 29 2c 20 61 6e | 64 20 74 68 65 20 70 61 |Log), an|d the pa|
|00001db0| 63 6b 61 67 65 20 74 68 | 61 74 20 65 78 70 6f 72 |ckage th|at expor|
|00001dc0| 74 65 64 20 74 68 65 6d | 20 28 4d 61 74 68 29 2e |ted them| (Math).|
|00001dd0| 0a 20 20 20 20 20 20 20 | 2e 2e 2e 0a 20 20 20 20 |. |.... |
|00001de0| 20 65 6e 64 20 45 78 61 | 6d 70 6c 65 5f 32 3b 0a | end Exa|mple_2;.|
|00001df0| 0a 0a 20 20 20 49 20 70 | 72 65 66 65 72 20 74 6f |.. I p|refer to|
|00001e00| 20 6d 61 6b 65 20 65 76 | 65 72 79 20 70 61 63 6b | make ev|ery pack|
|00001e10| 61 67 65 20 61 6e 64 20 | 73 75 62 70 72 6f 67 72 |age and |subprogr|
|00001e20| 61 6d 20 28 65 76 65 6e | 20 74 65 73 74 20 70 72 |am (even| test pr|
|00001e30| 6f 63 65 64 75 72 65 73 | 29 0a 20 20 20 61 73 20 |ocedures|). as |
|00001e40| 63 6f 6d 70 69 6c 65 72 | 20 69 6e 64 65 70 65 6e |compiler| indepen|
|00001e50| 64 65 6e 74 20 61 6e 64 | 20 6d 61 63 68 69 6e 65 |dent and| machine|
|00001e60| 20 70 6f 72 74 61 62 6c | 65 20 61 73 20 70 6f 73 | portabl|e as pos|
|00001e70| 73 69 62 6c 65 2e 20 54 | 6f 20 64 6f 20 74 68 69 |sible. T|o do thi|
|00001e80| 73 0a 20 20 20 79 6f 75 | 20 6d 6f 76 65 20 61 6c |s. you| move al|
|00001e90| 6c 20 6f 66 20 74 68 65 | 20 72 65 6e 61 6d 69 6e |l of the| renamin|
|00001ea0| 67 20 6f 66 20 63 6f 6d | 70 69 6c 65 72 20 64 65 |g of com|piler de|
|00001eb0| 70 65 6e 64 65 6e 74 20 | 66 75 6e 63 74 69 6f 6e |pendent |function|
|00001ec0| 73 20 61 6e 64 20 61 6c | 6c 0a 20 20 20 6f 66 20 |s and al|l. of |
|00001ed0| 74 68 65 20 22 77 69 74 | 68 69 6e 67 22 20 6f 66 |the "wit|hing" of|
|00001ee0| 20 63 6f 6d 70 69 6c 65 | 72 20 64 65 70 65 6e 64 | compile|r depend|
|00001ef0| 65 6e 74 20 70 61 63 6b | 61 67 65 73 20 74 6f 20 |ent pack|ages to |
|00001f00| 61 20 73 69 6e 67 6c 65 | 20 70 61 63 6b 61 67 65 |a single| package|
|00001f10| 2e 0a 20 20 20 49 6e 20 | 74 68 65 20 65 78 61 6d |.. In |the exam|
|00001f20| 70 6c 65 20 74 68 61 74 | 20 66 6f 6c 6c 6f 77 73 |ple that| follows|
|00001f30| 2c 20 69 74 73 20 63 61 | 6c 6c 65 64 20 4d 61 74 |, its ca|lled Mat|
|00001f40| 68 5f 4c 69 62 5f 38 2e | 20 4d 61 74 68 5f 4c 69 |h_Lib_8.| Math_Li|
|00001f50| 62 5f 38 20 72 65 6e 61 | 6d 65 73 0a 20 20 20 74 |b_8 rena|mes. t|
|00001f60| 68 65 20 38 2d 62 79 74 | 65 20 66 6c 6f 61 74 69 |he 8-byt|e floati|
|00001f70| 6e 67 20 70 6f 69 6e 74 | 20 74 79 70 65 20 74 6f |ng point| type to|
|00001f80| 20 52 65 61 6c 5f 38 2c | 20 61 6e 64 20 6d 61 6b | Real_8,| and mak|
|00001f90| 65 73 20 73 75 72 65 20 | 74 68 65 20 6d 61 74 68 |es sure |the math|
|00001fa0| 0a 20 20 20 66 75 6e 63 | 74 69 6f 6e 73 20 66 6f |. func|tions fo|
|00001fb0| 6c 6c 6f 77 20 74 68 65 | 20 41 64 61 20 39 35 20 |llow the| Ada 95 |
|00001fc0| 73 74 61 6e 64 61 72 64 | 2c 20 61 74 20 6c 65 61 |standard|, at lea|
|00001fd0| 73 74 20 69 6e 20 6e 61 | 6d 65 2e 20 49 6e 20 74 |st in na|me. In t|
|00001fe0| 68 69 73 0a 20 20 20 61 | 70 70 72 6f 61 63 68 20 |his. a|pproach |
|00001ff0| 4d 61 74 68 5f 4c 69 62 | 5f 38 20 69 73 20 74 68 |Math_Lib|_8 is th|
|00002000| 65 20 6f 6e 6c 79 20 63 | 6f 6d 70 69 6c 65 72 20 |e only c|ompiler |
|00002010| 64 65 70 65 6e 64 65 6e | 74 20 63 6f 6d 70 6f 6e |dependen|t compon|
|00002020| 65 6e 74 2e 0a 0a 20 20 | 20 54 68 65 72 65 20 61 |ent... | There a|
|00002030| 72 65 20 6f 74 68 65 72 | 2c 20 70 65 72 68 61 70 |re other|, perhap|
|00002040| 73 20 62 65 74 74 65 72 | 2c 20 77 61 79 73 20 61 |s better|, ways a|
|00002050| 6c 73 6f 2e 20 53 65 65 | 20 66 6f 72 20 65 78 61 |lso. See| for exa|
|00002060| 6d 70 6c 65 2c 20 22 41 | 64 61 20 49 6e 0a 20 20 |mple, "A|da In. |
|00002070| 20 41 63 74 69 6f 6e 22 | 2c 20 62 79 20 44 6f 2d | Action"|, by Do-|
|00002080| 57 68 69 6c 65 20 4a 6f | 6e 65 73 20 66 6f 72 20 |While Jo|nes for |
|00002090| 61 20 67 65 6e 65 72 69 | 63 20 73 6f 6c 75 74 69 |a generi|c soluti|
|000020a0| 6f 6e 2e 0a 0a 20 20 20 | 48 65 72 65 27 73 20 74 |on... |Here's t|
|000020b0| 68 65 20 73 70 65 63 20 | 6f 66 20 4d 61 74 68 5f |he spec |of Math_|
|000020c0| 4c 69 62 5f 38 2c 20 77 | 68 69 63 68 20 69 73 20 |Lib_8, w|hich is |
|000020d0| 61 20 70 65 72 66 65 63 | 74 20 73 75 62 73 65 74 |a perfec|t subset|
|000020e0| 20 6f 66 20 70 61 63 6b | 61 67 65 0a 20 20 20 4d | of pack|age. M|
|000020f0| 61 74 68 5f 45 6e 76 5f | 38 2c 20 61 76 61 69 6c |ath_Env_|8, avail|
|00002100| 61 62 6c 65 20 62 79 20 | 46 54 50 20 69 6e 20 66 |able by |FTP in f|
|00002110| 69 6c 65 0a 20 20 20 66 | 74 70 3a 2f 2f 6c 67 6c |ile. f|tp://lgl|
|00002120| 66 74 70 2e 65 70 66 6c | 2e 63 68 2f 70 75 62 2f |ftp.epfl|.ch/pub/|
|00002130| 41 64 61 2f 46 41 51 2f | 6d 61 74 68 5f 65 6e 76 |Ada/FAQ/|math_env|
|00002140| 5f 38 2e 61 64 61 0a 0a | 0a 2d 2d 2a 2a 2a 2a 2a |_8.ada..|.--*****|
|00002150| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002160| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002170| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002180| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 0a 2d 2d 20 50 61 |********|**.-- Pa|
|00002190| 63 6b 61 67 65 20 4d 61 | 74 68 5f 4c 69 62 5f 38 |ckage Ma|th_Lib_8|
|000021a0| 0a 2d 2d 0a 2d 2d 20 41 | 20 6d 69 6e 69 6d 61 6c |.--.-- A| minimal|
|000021b0| 20 6d 61 74 68 20 70 61 | 63 6b 61 67 65 20 66 6f | math pa|ckage fo|
|000021c0| 72 20 41 64 61 20 38 33 | 3a 20 63 72 65 61 74 65 |r Ada 83|: create|
|000021d0| 73 20 61 20 73 74 61 6e | 64 61 72 64 20 69 6e 74 |s a stan|dard int|
|000021e0| 65 72 66 61 63 65 20 74 | 6f 20 76 65 6e 64 6f 72 |erface t|o vendor|
|000021f0| 0a 2d 2d 20 73 70 65 63 | 69 66 69 63 20 64 6f 75 |.-- spec|ific dou|
|00002200| 62 6c 65 2d 70 72 65 63 | 69 73 69 6f 6e 20 28 38 |ble-prec|ision (8|
|00002210| 2d 62 79 74 65 29 20 6d | 61 74 68 20 6c 69 62 72 |-byte) m|ath libr|
|00002220| 61 72 69 65 73 2e 20 20 | 49 74 20 72 65 6e 61 6d |aries. |It renam|
|00002230| 65 73 20 74 68 65 20 38 | 20 62 79 74 65 0a 2d 2d |es the 8| byte.--|
|00002240| 20 46 6c 6f 61 74 69 6e | 67 20 70 6f 69 6e 74 20 | Floatin|g point |
|00002250| 74 79 70 65 20 74 6f 20 | 52 65 61 6c 5f 38 2c 20 |type to |Real_8, |
|00002260| 61 6e 64 20 75 73 65 73 | 20 72 65 6e 61 6d 69 6e |and uses| renamin|
|00002270| 67 20 74 6f 20 63 72 65 | 61 74 65 0a 2d 2d 20 28 |g to cre|ate.-- (|
|00002280| 41 64 61 20 39 35 29 20 | 73 74 61 6e 64 61 72 64 |Ada 95) |standard|
|00002290| 20 6e 61 6d 65 73 20 66 | 6f 72 20 53 69 6e 2c 20 | names f|or Sin, |
|000022a0| 43 6f 73 2c 20 4c 6f 67 | 2c 20 53 71 72 74 2c 20 |Cos, Log|, Sqrt, |
|000022b0| 41 72 63 73 69 6e 2c 20 | 45 78 70 2c 0a 2d 2d 20 |Arcsin, |Exp,.-- |
|000022c0| 61 6e 64 20 52 65 61 6c | 5f 38 5f 46 6c 6f 6f 72 |and Real|_8_Floor|
|000022d0| 2c 20 61 6c 6c 20 64 65 | 66 69 6e 65 64 20 66 6f |, all de|fined fo|
|000022e0| 72 20 52 65 61 6c 5f 38 | 2e 0a 2d 2d 0a 2d 2d 20 |r Real_8|..--.-- |
|000022f0| 41 20 6d 6f 72 65 20 61 | 6d 62 69 74 69 6f 75 73 |A more a|mbitious|
|00002300| 20 62 75 74 20 70 65 72 | 68 61 70 73 20 6c 65 73 | but per|haps les|
|00002310| 73 20 65 66 66 69 63 69 | 65 6e 74 0a 2d 2d 20 70 |s effici|ent.-- p|
|00002320| 61 63 6b 61 67 65 20 77 | 6f 75 6c 64 20 77 72 61 |ackage w|ould wra|
|00002330| 70 20 74 68 65 20 63 6f | 6d 70 69 6c 65 72 20 73 |p the co|mpiler s|
|00002340| 70 65 63 69 66 69 63 20 | 66 75 6e 63 74 69 6f 6e |pecific |function|
|00002350| 73 20 69 6e 20 66 75 6e | 63 74 69 6f 6e 20 63 61 |s in fun|ction ca|
|00002360| 6c 6c 73 2c 20 61 6e 64 | 0a 2d 2d 20 64 6f 20 65 |lls, and|.-- do e|
|00002370| 72 72 6f 72 20 68 61 6e | 64 6c 69 6e 67 20 6f 6e |rror han|dling on|
|00002380| 20 74 68 65 20 61 72 67 | 75 6d 65 6e 74 73 20 74 | the arg|uments t|
|00002390| 6f 20 41 64 61 20 39 35 | 20 73 74 61 6e 64 61 72 |o Ada 95| standar|
|000023a0| 64 73 2e 0a 2d 2d 0a 2d | 2d 20 54 68 65 20 70 61 |ds..--.-|- The pa|
|000023b0| 63 6b 61 67 65 20 61 73 | 73 75 6d 65 73 20 74 68 |ckage as|sumes th|
|000023c0| 61 74 20 52 65 61 6c 5f | 38 27 44 69 67 69 74 73 |at Real_|8'Digits|
|000023d0| 20 3e 20 31 33 2c 20 61 | 6e 64 20 74 68 61 74 0a | > 13, a|nd that.|
|000023e0| 2d 2d 20 52 65 61 6c 5f | 38 27 4d 61 63 68 69 6e |-- Real_|8'Machin|
|000023f0| 65 5f 4d 61 6e 74 69 73 | 73 61 20 3c 20 36 31 2e |e_Mantis|sa < 61.|
|00002400| 20 20 54 68 65 73 65 20 | 61 72 65 20 61 73 73 65 | These |are asse|
|00002410| 72 74 65 64 20 61 66 74 | 65 72 20 74 68 65 0a 2d |rted aft|er the.-|
|00002420| 2d 20 62 65 67 69 6e 20 | 73 74 61 74 65 6d 65 6e |- begin |statemen|
|00002430| 74 20 69 6e 20 74 68 65 | 20 62 6f 64 79 2e 0a 2d |t in the| body..-|
|00002440| 2d 0a 2d 2d 20 53 6f 6d | 65 20 41 64 61 20 38 33 |-.-- Som|e Ada 83|
|00002450| 20 63 6f 6d 70 69 6c 65 | 72 73 20 64 6f 6e 27 74 | compile|rs don't|
|00002460| 20 70 72 6f 76 69 64 65 | 20 41 72 63 73 69 6e 2c | provide| Arcsin,|
|00002470| 20 73 6f 20 61 20 72 61 | 74 69 6f 6e 61 6c 2d 70 | so a ra|tional-p|
|00002480| 6f 6c 79 6e 6f 6d 69 61 | 6c 2b 0a 2d 2d 20 4e 65 |olynomia|l+.-- Ne|
|00002490| 77 74 6f 6e 2d 52 61 70 | 68 73 6f 6e 20 6d 65 74 |wton-Rap|hson met|
|000024a0| 68 6f 64 20 41 72 63 73 | 69 6e 20 61 6e 64 20 41 |hod Arcs|in and A|
|000024b0| 72 63 63 6f 73 20 70 61 | 69 72 20 61 72 65 20 70 |rccos pa|ir are p|
|000024c0| 72 6f 76 69 64 65 64 20 | 69 6e 20 74 68 65 20 62 |rovided |in the b|
|000024d0| 6f 64 79 2e 0a 2d 2d 0a | 2d 2d 20 53 6f 6d 65 20 |ody..--.|-- Some |
|000024e0| 41 64 61 20 38 33 20 63 | 6f 6d 70 69 6c 65 72 73 |Ada 83 c|ompilers|
|000024f0| 20 64 6f 6e 27 74 20 70 | 72 6f 76 69 64 65 20 66 | don't p|rovide f|
|00002500| 6f 72 20 74 72 75 6e 63 | 61 74 69 6f 6e 20 6f 66 |or trunc|ation of|
|00002510| 20 38 20 62 79 74 65 20 | 66 6c 6f 61 74 73 2e 0a | 8 byte |floats..|
|00002520| 2d 2d 20 54 72 75 6e 63 | 61 74 69 6f 6e 20 69 73 |-- Trunc|ation is|
|00002530| 20 70 72 6f 76 69 64 65 | 64 20 68 65 72 65 20 69 | provide|d here i|
|00002540| 6e 20 73 6f 66 74 77 61 | 72 65 20 66 6f 72 20 43 |n softwa|re for C|
|00002550| 6f 6d 70 69 6c 65 72 73 | 20 74 68 61 74 20 64 6f |ompilers| that do|
|00002560| 6e 27 74 20 68 61 76 65 | 20 69 74 2e 0a 2d 2d 20 |n't have| it..-- |
|00002570| 54 68 65 20 41 64 61 20 | 39 35 20 66 75 6e 63 74 |The Ada |95 funct|
|00002580| 69 6f 6e 20 66 6f 72 20 | 74 72 75 6e 63 61 74 69 |ion for |truncati|
|00002590| 6e 67 20 28 74 6f 77 61 | 72 64 20 6e 65 67 20 69 |ng (towa|rd neg i|
|000025a0| 6e 66 69 6e 69 74 79 29 | 20 69 73 20 63 61 6c 6c |nfinity)| is call|
|000025b0| 65 64 20 27 46 6c 6f 6f | 72 2e 0a 2d 2d 0a 2d 2d |ed 'Floo|r..--.--|
|000025c0| 20 54 68 65 20 6e 61 6d | 65 73 20 6f 66 20 74 68 | The nam|es of th|
|000025d0| 65 20 66 75 6e 63 74 69 | 6f 6e 73 20 65 78 70 6f |e functi|ons expo|
|000025e0| 72 74 65 64 20 62 65 6c | 6f 77 20 61 67 72 65 65 |rted bel|ow agree|
|000025f0| 20 77 69 74 68 20 74 68 | 65 20 41 64 61 39 58 20 | with th|e Ada9X |
|00002600| 73 74 61 6e 64 61 72 64 | 2c 0a 2d 2d 20 62 75 74 |standard|,.-- but|
|00002610| 20 6e 6f 74 2c 20 69 6e | 20 61 6c 6c 20 6c 69 6b | not, in| all lik|
|00002620| 65 6c 69 68 6f 6f 64 20 | 74 68 65 20 73 65 6d 61 |elihood |the sema|
|00002630| 6e 74 69 63 73 2e 20 20 | 20 49 74 20 69 73 20 75 |ntics. | It is u|
|00002640| 70 20 74 6f 20 74 68 65 | 20 75 73 65 72 20 74 6f |p to the| user to|
|00002650| 0a 2d 2d 20 62 65 20 63 | 61 72 65 66 75 6c 2e 2e |.-- be c|areful..|
|00002660| 2e 74 6f 20 64 6f 20 68 | 69 73 20 6f 77 6e 20 65 |.to do h|is own e|
|00002670| 72 72 6f 72 20 68 61 6e | 64 6c 69 6e 67 20 6f 6e |rror han|dling on|
|00002680| 20 74 68 65 20 61 72 67 | 75 6d 65 6e 74 73 2c 20 | the arg|uments, |
|00002690| 65 74 63 2e 0a 2d 2d 20 | 54 68 65 20 70 65 72 66 |etc..-- |The perf|
|000026a0| 6f 72 6d 61 6e 63 65 20 | 6f 66 20 74 68 65 73 65 |ormance |of these|
|000026b0| 20 66 75 6e 63 74 69 6f | 6e 20 63 61 6e 20 62 65 | functio|n can be|
|000026c0| 20 6e 6f 6e 2d 70 6f 72 | 74 61 62 6c 65 2c 0a 2d | non-por|table,.-|
|000026d0| 2d 20 62 75 74 20 69 6e | 20 70 72 61 63 74 69 63 |- but in| practic|
|000026e0| 65 20 74 68 65 79 20 68 | 61 76 65 20 74 68 65 69 |e they h|ave thei|
|000026f0| 72 20 75 73 75 61 6c 20 | 6d 65 61 6e 69 6e 67 73 |r usual |meanings|
|00002700| 20 75 6e 6c 65 73 73 20 | 79 6f 75 20 63 68 6f 6f | unless |you choo|
|00002710| 73 65 0a 2d 2d 20 77 65 | 69 72 64 20 61 72 67 75 |se.-- we|ird argu|
|00002720| 6d 65 6e 74 73 2e 20 20 | 54 68 65 20 69 73 73 75 |ments. |The issu|
|00002730| 65 73 20 61 72 65 20 74 | 68 65 20 73 61 6d 65 20 |es are t|he same |
|00002740| 77 69 74 68 20 6d 6f 73 | 74 20 6d 61 74 68 20 6c |with mos|t math l|
|00002750| 69 62 72 61 72 69 65 73 | 2e 0a 2d 2d 2a 2a 2a 2a |ibraries|..--****|
|00002760| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002770| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002780| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002790| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 0a 0a 2d 2d 77 |********|***..--w|
|000027a0| 69 74 68 20 4d 61 74 68 | 5f 4c 69 62 3b 20 20 20 |ith Math|_Lib; |
|000027b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000027c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2d | | -|
|000027d0| 2d 20 4d 65 72 69 64 69 | 61 6e 20 44 4f 53 20 41 |- Meridi|an DOS A|
|000027e0| 64 61 2e 0a 20 20 77 69 | 74 68 20 4c 6f 6e 67 5f |da.. wi|th Long_|
|000027f0| 46 6c 6f 61 74 5f 4d 61 | 74 68 5f 4c 69 62 3b 20 |Float_Ma|th_Lib; |
|00002800| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002810| 20 20 20 20 20 20 2d 2d | 20 44 65 63 20 56 4d 53 | --| Dec VMS|
|00002820| 0a 2d 2d 77 69 74 68 20 | 41 64 61 2e 4e 75 6d 65 |.--with |Ada.Nume|
|00002830| 72 69 63 73 2e 47 65 6e | 65 72 69 63 5f 45 6c 65 |rics.Gen|eric_Ele|
|00002840| 6d 65 6e 74 61 72 79 5f | 46 75 6e 63 74 69 6f 6e |mentary_|Function|
|00002850| 73 3b 20 2d 2d 20 41 64 | 61 39 58 0a 70 61 63 6b |s; -- Ad|a9X.pack|
|00002860| 61 67 65 20 4d 61 74 68 | 5f 4c 69 62 5f 38 20 69 |age Math|_Lib_8 i|
|00002870| 73 0a 0a 2d 2d 73 75 62 | 74 79 70 65 20 52 65 61 |s..--sub|type Rea|
|00002880| 6c 5f 38 20 69 73 20 46 | 6c 6f 61 74 3b 20 20 20 |l_8 is F|loat; |
|00002890| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000028a0| 20 20 20 20 20 2d 2d 20 | 4d 65 72 69 64 69 61 6e | -- |Meridian|
|000028b0| 20 38 2d 62 79 74 65 20 | 52 65 61 6c 0a 20 20 73 | 8-byte |Real. s|
|000028c0| 75 62 74 79 70 65 20 52 | 65 61 6c 5f 38 20 69 73 |ubtype R|eal_8 is|
|000028d0| 20 4c 6f 6e 67 5f 46 6c | 6f 61 74 3b 20 20 20 20 | Long_Fl|oat; |
|000028e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2d | | -|
|000028f0| 2d 20 44 65 63 20 56 4d | 53 20 20 38 2d 62 79 74 |- Dec VM|S 8-byt|
|00002900| 65 20 52 65 61 6c 0a 0a | 20 2d 2d 70 61 63 6b 61 |e Real..| --packa|
|00002910| 67 65 20 4d 61 74 68 20 | 72 65 6e 61 6d 65 73 20 |ge Math |renames |
|00002920| 4d 61 74 68 5f 4c 69 62 | 3b 20 20 20 20 20 20 20 |Math_Lib|; |
|00002930| 20 20 20 20 20 20 20 20 | 20 20 2d 2d 20 4d 65 72 | | -- Mer|
|00002940| 69 64 69 61 6e 20 44 4f | 53 20 41 64 61 0a 20 20 |idian DO|S Ada. |
|00002950| 20 70 61 63 6b 61 67 65 | 20 4d 61 74 68 20 72 65 | package| Math re|
|00002960| 6e 61 6d 65 73 20 4c 6f | 6e 67 5f 46 6c 6f 61 74 |names Lo|ng_Float|
|00002970| 5f 4d 61 74 68 5f 4c 69 | 62 3b 20 20 20 20 20 20 |_Math_Li|b; |
|00002980| 2d 2d 20 44 65 63 20 56 | 4d 53 0a 20 2d 2d 70 61 |-- Dec V|MS. --pa|
|00002990| 63 6b 61 67 65 20 4d 61 | 74 68 20 69 73 20 6e 65 |ckage Ma|th is ne|
|000029a0| 77 20 41 64 61 2e 4e 75 | 6d 65 72 69 63 73 2e 47 |w Ada.Nu|merics.G|
|000029b0| 65 6e 65 72 69 63 5f 45 | 6c 65 6d 65 6e 74 61 72 |eneric_E|lementar|
|000029c0| 79 5f 46 75 6e 63 74 69 | 6f 6e 73 28 52 65 61 6c |y_Functi|ons(Real|
|000029d0| 5f 38 29 3b 0a 0a 20 20 | 20 2d 2d 20 20 54 68 65 |_8);.. | -- The|
|000029e0| 20 61 62 6f 76 65 20 69 | 6e 73 74 61 6e 74 69 61 | above i|nstantia|
|000029f0| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 41 64 61 2e |tion of |the Ada.|
|00002a00| 4e 75 6d 65 72 69 63 73 | 20 63 68 69 6c 64 20 70 |Numerics| child p|
|00002a10| 61 63 6b 61 67 65 20 77 | 6f 72 6b 73 20 6f 6e 0a |ackage w|orks on.|
|00002a20| 20 20 20 2d 2d 20 20 47 | 4e 41 54 2c 20 6f 72 20 | -- G|NAT, or |
|00002a30| 61 6e 79 20 6f 74 68 65 | 72 20 41 64 61 20 39 35 |any othe|r Ada 95|
|00002a40| 20 63 6f 6d 70 69 6c 65 | 72 2e 20 20 49 74 73 20 | compile|r. Its |
|00002a50| 68 65 72 65 20 69 66 20 | 79 6f 75 20 77 61 6e 74 |here if |you want|
|00002a60| 20 74 6f 20 75 73 65 0a | 20 20 20 2d 2d 20 20 61 | to use.| -- a|
|00002a70| 6e 20 41 64 61 20 39 35 | 20 63 6f 6d 70 69 6c 65 |n Ada 95| compile|
|00002a80| 72 20 74 6f 20 63 6f 6d | 70 69 6c 65 20 41 64 61 |r to com|pile Ada|
|00002a90| 20 38 33 20 70 72 6f 67 | 72 61 6d 73 20 62 61 73 | 83 prog|rams bas|
|00002aa0| 65 64 20 6f 6e 20 74 68 | 69 73 20 70 61 63 6b 61 |ed on th|is packa|
|00002ab0| 67 65 2e 0a 0a 20 20 20 | 66 75 6e 63 74 69 6f 6e |ge... |function|
|00002ac0| 20 43 6f 73 20 28 58 20 | 3a 20 52 65 61 6c 5f 38 | Cos (X |: Real_8|
|00002ad0| 29 20 72 65 74 75 72 6e | 20 52 65 61 6c 5f 38 20 |) return| Real_8 |
|00002ae0| 72 65 6e 61 6d 65 73 20 | 4d 61 74 68 2e 43 6f 73 |renames |Math.Cos|
|00002af0| 3b 0a 20 20 20 66 75 6e | 63 74 69 6f 6e 20 53 69 |;. fun|ction Si|
|00002b00| 6e 20 28 58 20 3a 20 52 | 65 61 6c 5f 38 29 20 72 |n (X : R|eal_8) r|
|00002b10| 65 74 75 72 6e 20 52 65 | 61 6c 5f 38 20 72 65 6e |eturn Re|al_8 ren|
|00002b20| 61 6d 65 73 20 4d 61 74 | 68 2e 53 69 6e 3b 0a 20 |ames Mat|h.Sin;. |
|00002b30| 20 20 66 75 6e 63 74 69 | 6f 6e 20 53 71 72 74 28 | functi|on Sqrt(|
|00002b40| 58 20 3a 20 52 65 61 6c | 5f 38 29 20 72 65 74 75 |X : Real|_8) retu|
|00002b50| 72 6e 20 52 65 61 6c 5f | 38 20 72 65 6e 61 6d 65 |rn Real_|8 rename|
|00002b60| 73 20 4d 61 74 68 2e 53 | 71 72 74 3b 0a 20 20 20 |s Math.S|qrt;. |
|00002b70| 66 75 6e 63 74 69 6f 6e | 20 45 78 70 20 28 58 20 |function| Exp (X |
|00002b80| 3a 20 52 65 61 6c 5f 38 | 29 20 72 65 74 75 72 6e |: Real_8|) return|
|00002b90| 20 52 65 61 6c 5f 38 20 | 72 65 6e 61 6d 65 73 20 | Real_8 |renames |
|00002ba0| 4d 61 74 68 2e 45 78 70 | 3b 0a 0a 20 2d 2d 66 75 |Math.Exp|;.. --fu|
|00002bb0| 6e 63 74 69 6f 6e 20 4c | 6f 67 20 28 58 20 3a 20 |nction L|og (X : |
|00002bc0| 52 65 61 6c 5f 38 29 20 | 72 65 74 75 72 6e 20 52 |Real_8) |return R|
|00002bd0| 65 61 6c 5f 38 20 72 65 | 6e 61 6d 65 73 20 4d 61 |eal_8 re|names Ma|
|00002be0| 74 68 2e 4c 6e 3b 20 20 | 20 20 20 20 20 20 2d 2d |th.Ln; | --|
|00002bf0| 20 4d 65 72 69 64 69 61 | 6e 0a 20 20 20 66 75 6e | Meridia|n. fun|
|00002c00| 63 74 69 6f 6e 20 4c 6f | 67 20 28 58 20 3a 20 52 |ction Lo|g (X : R|
|00002c10| 65 61 6c 5f 38 29 20 72 | 65 74 75 72 6e 20 52 65 |eal_8) r|eturn Re|
|00002c20| 61 6c 5f 38 20 72 65 6e | 61 6d 65 73 20 4d 61 74 |al_8 ren|ames Mat|
|00002c30| 68 2e 4c 6f 67 3b 20 20 | 20 20 20 20 20 2d 2d 20 |h.Log; | -- |
|00002c40| 44 65 63 20 56 4d 53 0a | 20 2d 2d 66 75 6e 63 74 |Dec VMS.| --funct|
|00002c50| 69 6f 6e 20 4c 6f 67 20 | 28 58 20 3a 20 52 65 61 |ion Log |(X : Rea|
|00002c60| 6c 5f 38 29 20 72 65 74 | 75 72 6e 20 52 65 61 6c |l_8) ret|urn Real|
|00002c70| 5f 38 20 72 65 6e 61 6d | 65 73 20 4d 61 74 68 2e |_8 renam|es Math.|
|00002c80| 4c 6f 67 3b 20 20 20 20 | 20 20 20 2d 2d 20 41 64 |Log; | -- Ad|
|00002c90| 61 20 39 35 0a 0a 20 2d | 2d 66 75 6e 63 74 69 6f |a 95.. -|-functio|
|00002ca0| 6e 20 41 72 63 73 69 6e | 20 28 58 20 3a 20 52 65 |n Arcsin| (X : Re|
|00002cb0| 61 6c 5f 38 29 20 72 65 | 74 75 72 6e 20 52 65 61 |al_8) re|turn Rea|
|00002cc0| 6c 5f 38 20 72 65 6e 61 | 6d 65 73 20 4d 61 74 68 |l_8 rena|mes Math|
|00002cd0| 2e 41 73 69 6e 3b 20 20 | 20 2d 2d 20 44 65 63 20 |.Asin; | -- Dec |
|00002ce0| 56 4d 53 0a 20 2d 2d 66 | 75 6e 63 74 69 6f 6e 20 |VMS. --f|unction |
|00002cf0| 41 72 63 73 69 6e 20 28 | 58 20 3a 20 52 65 61 6c |Arcsin (|X : Real|
|00002d00| 5f 38 29 20 72 65 74 75 | 72 6e 20 52 65 61 6c 5f |_8) retu|rn Real_|
|00002d10| 38 20 72 65 6e 61 6d 65 | 73 20 4d 61 74 68 2e 41 |8 rename|s Math.A|
|00002d20| 72 63 73 69 6e 3b 20 2d | 2d 20 41 64 61 20 39 35 |rcsin; -|- Ada 95|
|00002d30| 0a 20 20 20 66 75 6e 63 | 74 69 6f 6e 20 41 72 63 |. func|tion Arc|
|00002d40| 73 69 6e 20 28 58 20 3a | 20 52 65 61 6c 5f 38 29 |sin (X :| Real_8)|
|00002d50| 20 72 65 74 75 72 6e 20 | 52 65 61 6c 5f 38 3b 0a | return |Real_8;.|
|00002d60| 20 20 20 2d 2d 20 20 49 | 6d 70 6c 65 6d 65 6e 74 | -- I|mplement|
|00002d70| 65 64 20 69 6e 20 74 68 | 65 20 62 6f 64 79 2e 20 |ed in th|e body. |
|00002d80| 20 53 68 6f 75 6c 64 20 | 77 6f 72 6b 20 77 69 74 | Should |work wit|
|00002d90| 68 20 61 6e 79 20 63 6f | 6d 70 69 6c 65 72 2e 0a |h any co|mpiler..|
|00002da0| 0a 20 2d 2d 66 75 6e 63 | 74 69 6f 6e 20 41 72 63 |. --func|tion Arc|
|00002db0| 63 6f 73 20 28 58 20 3a | 20 52 65 61 6c 5f 38 29 |cos (X :| Real_8)|
|00002dc0| 20 72 65 74 75 72 6e 20 | 52 65 61 6c 5f 38 20 72 | return |Real_8 r|
|00002dd0| 65 6e 61 6d 65 73 20 4d | 61 74 68 2e 41 63 6f 73 |enames M|ath.Acos|
|00002de0| 3b 20 20 20 2d 2d 20 44 | 65 63 20 56 4d 53 0a 20 |; -- D|ec VMS. |
|00002df0| 2d 2d 66 75 6e 63 74 69 | 6f 6e 20 41 72 63 63 6f |--functi|on Arcco|
|00002e00| 73 20 28 58 20 3a 20 52 | 65 61 6c 5f 38 29 20 72 |s (X : R|eal_8) r|
|00002e10| 65 74 75 72 6e 20 52 65 | 61 6c 5f 38 20 72 65 6e |eturn Re|al_8 ren|
|00002e20| 61 6d 65 73 20 4d 61 74 | 68 2e 41 72 63 63 6f 73 |ames Mat|h.Arccos|
|00002e30| 3b 20 2d 2d 20 41 64 61 | 20 39 35 0a 20 20 20 66 |; -- Ada| 95. f|
|00002e40| 75 6e 63 74 69 6f 6e 20 | 41 72 63 63 6f 73 20 28 |unction |Arccos (|
|00002e50| 58 20 3a 20 52 65 61 6c | 5f 38 29 20 72 65 74 75 |X : Real|_8) retu|
|00002e60| 72 6e 20 52 65 61 6c 5f | 38 3b 0a 20 20 20 2d 2d |rn Real_|8;. --|
|00002e70| 20 20 49 6d 70 6c 65 6d | 65 6e 74 65 64 20 69 6e | Implem|ented in|
|00002e80| 20 74 68 65 20 62 6f 64 | 79 2e 20 20 53 68 6f 75 | the bod|y. Shou|
|00002e90| 6c 64 20 77 6f 72 6b 20 | 77 69 74 68 20 61 6e 79 |ld work |with any|
|00002ea0| 20 63 6f 6d 70 69 6c 65 | 72 2e 0a 0a 20 2d 2d 66 | compile|r... --f|
|00002eb0| 75 6e 63 74 69 6f 6e 20 | 52 65 61 6c 5f 38 5f 46 |unction |Real_8_F|
|00002ec0| 6c 6f 6f 72 20 28 58 20 | 3a 20 52 65 61 6c 5f 38 |loor (X |: Real_8|
|00002ed0| 29 20 72 65 74 75 72 6e | 20 52 65 61 6c 5f 38 20 |) return| Real_8 |
|00002ee0| 72 65 6e 61 6d 65 73 20 | 52 65 61 6c 5f 38 27 46 |renames |Real_8'F|
|00002ef0| 6c 6f 6f 72 3b 2d 2d 20 | 39 35 0a 20 20 20 66 75 |loor;-- |95. fu|
|00002f00| 6e 63 74 69 6f 6e 20 52 | 65 61 6c 5f 38 5f 46 6c |nction R|eal_8_Fl|
|00002f10| 6f 6f 72 20 28 58 20 3a | 20 52 65 61 6c 5f 38 29 |oor (X :| Real_8)|
|00002f20| 20 72 65 74 75 72 6e 20 | 52 65 61 6c 5f 38 3b 0a | return |Real_8;.|
|00002f30| 20 20 20 2d 2d 20 20 49 | 6d 70 6c 65 6d 65 6e 74 | -- I|mplement|
|00002f40| 65 64 20 69 6e 20 74 68 | 65 20 62 6f 64 79 2e 20 |ed in th|e body. |
|00002f50| 20 53 68 6f 75 6c 64 20 | 77 6f 72 6b 20 77 69 74 | Should |work wit|
|00002f60| 68 20 61 6e 79 20 63 6f | 6d 70 69 6c 65 72 2e 0a |h any co|mpiler..|
|00002f70| 0a 65 6e 64 20 4d 61 74 | 68 5f 4c 69 62 5f 38 3b |.end Mat|h_Lib_8;|
|00002f80| 0a 0a 0a 36 2e 33 3a 20 | 49 73 20 41 64 61 20 61 |...6.3: |Is Ada a|
|00002f90| 6e 79 20 67 6f 6f 64 20 | 61 74 20 6e 75 6d 65 72 |ny good |at numer|
|00002fa0| 69 63 73 2c 20 61 6e 64 | 20 77 68 65 72 65 20 63 |ics, and| where c|
|00002fb0| 61 6e 20 49 20 6c 65 61 | 72 6e 20 6d 6f 72 65 20 |an I lea|rn more |
|00002fc0| 61 62 6f 75 74 20 69 74 | 3f 0a 0a 20 20 20 46 69 |about it|?.. Fi|
|00002fd0| 72 73 74 20 6f 66 20 61 | 6c 6c 2c 20 61 20 6c 6f |rst of a|ll, a lo|
|00002fe0| 74 20 6f 66 20 70 65 6f | 70 6c 65 20 66 69 6e 64 |t of peo|ple find|
|00002ff0| 20 74 68 65 20 67 65 6e | 65 72 61 6c 20 41 64 61 | the gen|eral Ada|
|00003000| 20 70 68 69 6c 6f 73 6f | 70 68 79 0a 20 20 20 28 | philoso|phy. (|
|00003010| 6d 6f 64 75 6c 61 72 69 | 74 79 2c 20 73 74 72 6f |modulari|ty, stro|
|00003020| 6e 67 2d 74 79 70 69 6e | 67 2c 20 72 65 61 64 61 |ng-typin|g, reada|
|00003030| 62 6c 65 20 73 79 6e 74 | 61 78 2c 20 72 69 67 6f |ble synt|ax, rigo|
|00003040| 72 6f 75 73 20 64 65 66 | 69 6e 69 74 69 6f 6e 20 |rous def|inition |
|00003050| 61 6e 64 0a 20 20 20 73 | 74 61 6e 64 61 72 64 69 |and. s|tandardi|
|00003060| 7a 61 74 69 6f 6e 2c 20 | 65 74 63 2e 29 20 74 6f |zation, |etc.) to|
|00003070| 20 62 65 20 61 20 72 65 | 61 6c 20 62 65 6e 65 66 | be a re|al benef|
|00003080| 69 74 20 69 6e 20 6e 75 | 6d 65 72 69 63 61 6c 20 |it in nu|merical |
|00003090| 70 72 6f 67 72 61 6d 6d | 69 6e 67 2c 0a 20 20 20 |programm|ing,. |
|000030a0| 61 73 20 77 65 6c 6c 20 | 61 73 20 69 6e 20 6d 61 |as well |as in ma|
|000030b0| 6e 79 20 6f 74 68 65 72 | 20 74 79 70 65 73 20 6f |ny other| types o|
|000030c0| 66 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 2e 20 42 |f progra|mming. B|
|000030d0| 75 74 20 41 64 61 20 2d | 2d 61 6e 64 0a 20 20 20 |ut Ada -|-and. |
|000030e0| 65 73 70 65 63 69 61 6c | 6c 79 20 41 64 61 20 39 |especial|ly Ada 9|
|000030f0| 35 2d 2d 20 77 61 73 20 | 61 6c 73 6f 20 64 65 73 |5-- was |also des|
|00003100| 69 67 6e 65 64 20 74 6f | 20 6d 65 65 74 20 74 68 |igned to| meet th|
|00003110| 65 20 73 70 65 63 69 61 | 6c 20 72 65 71 75 69 72 |e specia|l requir|
|00003120| 65 6d 65 6e 74 73 0a 20 | 20 20 6f 66 20 6e 75 6d |ements. | of num|
|00003130| 62 65 72 2d 63 72 75 6e | 63 68 69 6e 67 20 61 70 |ber-crun|ching ap|
|00003140| 70 6c 69 63 61 74 69 6f | 6e 73 2e 0a 0a 20 20 20 |plicatio|ns... |
|00003150| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 73 6b |The foll|owing sk|
|00003160| 65 74 63 68 65 73 20 6f | 75 74 20 73 6f 6d 65 20 |etches o|ut some |
|00003170| 6f 66 20 74 68 65 73 65 | 20 66 65 61 74 75 72 65 |of these| feature|
|00003180| 73 2e 20 48 6f 70 65 66 | 75 6c 6c 79 20 61 20 6c |s. Hopef|ully a l|
|00003190| 69 74 74 6c 65 0a 20 20 | 20 6f 66 20 74 68 65 20 |ittle. | of the |
|000031a0| 66 6c 61 76 6f 72 20 6f | 66 20 74 68 65 20 41 64 |flavor o|f the Ad|
|000031b0| 61 20 70 68 69 6c 6f 73 | 6f 70 68 79 20 77 69 6c |a philos|ophy wil|
|000031c0| 6c 20 67 65 74 20 74 68 | 72 6f 75 67 68 2c 20 62 |l get th|rough, b|
|000031d0| 75 74 20 74 68 65 20 62 | 65 73 74 0a 20 20 20 74 |ut the b|est. t|
|000031e0| 68 69 6e 67 20 79 6f 75 | 20 63 61 6e 20 64 6f 20 |hing you| can do |
|000031f0| 61 74 20 70 72 65 73 65 | 6e 74 20 69 73 20 74 6f |at prese|nt is to|
|00003200| 20 72 65 61 64 20 74 68 | 65 20 74 77 6f 20 73 74 | read th|e two st|
|00003210| 61 6e 64 61 72 64 20 72 | 65 66 65 72 65 6e 63 65 |andard r|eference|
|00003220| 0a 20 20 20 64 6f 63 75 | 6d 65 6e 74 73 2c 20 74 |. docu|ments, t|
|00003230| 68 65 20 41 64 61 20 39 | 35 20 52 61 74 69 6f 6e |he Ada 9|5 Ration|
|00003240| 61 6c 65 20 61 6e 64 20 | 52 65 66 65 72 65 6e 63 |ale and |Referenc|
|00003250| 65 20 4d 61 6e 75 61 6c | 2e 20 42 65 6c 6f 77 20 |e Manual|. Below |
|00003260| 74 68 65 20 47 4e 55 0a | 20 20 20 41 64 61 20 39 |the GNU.| Ada 9|
|00003270| 35 20 63 6f 6d 70 69 6c | 65 72 20 69 73 20 72 65 |5 compil|er is re|
|00003280| 66 65 72 72 65 64 20 74 | 6f 20 73 65 76 65 72 61 |ferred t|o severa|
|00003290| 6c 20 74 69 6d 65 73 2e | 20 54 68 69 73 20 63 6f |l times.| This co|
|000032a0| 6d 70 69 6c 65 72 20 63 | 61 6e 20 62 65 0a 20 20 |mpiler c|an be. |
|000032b0| 20 6f 62 74 61 69 6e 65 | 64 20 62 79 20 61 6e 6f | obtaine|d by ano|
|000032c0| 6e 79 6d 6f 75 73 20 46 | 54 50 20 66 72 6f 6d 20 |nymous F|TP from |
|000032d0| 63 73 2e 6e 79 75 2e 65 | 64 75 2c 20 61 6e 64 20 |cs.nyu.e|du, and |
|000032e0| 61 74 20 6d 69 72 72 6f | 72 20 73 69 74 65 73 0a |at mirro|r sites.|
|000032f0| 20 20 20 64 65 63 6c 61 | 72 65 64 20 69 6e 20 74 | decla|red in t|
|00003300| 68 65 20 52 45 41 44 4d | 45 20 66 69 6c 65 20 6f |he READM|E file o|
|00003310| 66 20 64 69 72 65 63 74 | 6f 72 79 20 70 75 62 2f |f direct|ory pub/|
|00003320| 67 6e 61 74 2e 0a 0a 20 | 20 20 31 2e 20 4d 61 63 |gnat... | 1. Mac|
|00003330| 68 69 6e 65 20 70 6f 72 | 74 61 62 6c 65 20 66 6c |hine por|table fl|
|00003340| 6f 61 74 69 6e 67 20 70 | 6f 69 6e 74 20 64 65 63 |oating p|oint dec|
|00003350| 6c 61 72 61 74 69 6f 6e | 73 2e 20 28 41 64 61 20 |laration|s. (Ada |
|00003360| 38 33 20 61 6e 64 20 41 | 64 61 20 39 35 29 0a 20 |83 and A|da 95). |
|00003370| 20 20 20 20 20 20 20 20 | 20 49 66 20 79 6f 75 20 | | If you |
|00003380| 64 65 63 6c 61 72 65 20 | 22 74 79 70 65 20 52 65 |declare |"type Re|
|00003390| 61 6c 20 69 73 20 64 69 | 67 69 74 73 20 31 34 22 |al is di|gits 14"|
|000033a0| 2c 20 74 68 65 6e 20 74 | 79 70 65 20 52 65 61 6c |, then t|ype Real|
|000033b0| 20 77 69 6c 6c 0a 20 20 | 20 20 20 20 20 20 20 20 | will. | |
|000033c0| 67 75 61 72 61 6e 74 65 | 65 20 79 6f 75 20 28 61 |guarante|e you (a|
|000033d0| 74 20 6c 65 61 73 74 29 | 20 31 34 20 64 69 67 69 |t least)| 14 digi|
|000033e0| 74 73 20 6f 66 20 70 72 | 65 63 69 73 69 6f 6e 20 |ts of pr|ecision |
|000033f0| 69 6e 64 65 70 65 6e 64 | 65 6e 74 6c 79 0a 20 20 |independ|ently. |
|00003400| 20 20 20 20 20 20 20 20 | 6f 66 20 6d 61 63 68 69 | |of machi|
|00003410| 6e 65 20 6f 72 20 63 6f | 6d 70 69 6c 65 72 2e 20 |ne or co|mpiler. |
|00003420| 49 6e 20 74 68 69 73 20 | 63 61 73 65 20 74 68 65 |In this |case the|
|00003430| 20 62 61 73 65 20 74 79 | 70 65 20 6f 66 20 74 79 | base ty|pe of ty|
|00003440| 70 65 20 52 65 61 6c 0a | 20 20 20 20 20 20 20 20 |pe Real.| |
|00003450| 20 20 77 69 6c 6c 20 75 | 73 75 61 6c 6c 79 20 62 | will u|sually b|
|00003460| 65 20 74 68 65 20 6d 61 | 63 68 69 6e 65 27 73 20 |e the ma|chine's |
|00003470| 38 2d 62 79 74 65 20 66 | 6c 6f 61 74 69 6e 67 20 |8-byte f|loating |
|00003480| 70 6f 69 6e 74 20 74 79 | 70 65 2e 20 49 66 20 61 |point ty|pe. If a|
|00003490| 6e 0a 20 20 20 20 20 20 | 20 20 20 20 61 70 70 72 |n. | appr|
|000034a0| 6f 70 72 69 61 74 65 20 | 62 61 73 65 20 74 79 70 |opriate |base typ|
|000034b0| 65 20 69 73 20 75 6e 61 | 76 61 69 6c 61 62 6c 65 |e is una|vailable|
|000034c0| 20 28 76 65 72 79 20 72 | 61 72 65 29 2c 20 74 68 | (very r|are), th|
|000034d0| 65 6e 20 74 68 65 0a 20 | 20 20 20 20 20 20 20 20 |en the. | |
|000034e0| 20 64 65 63 6c 61 72 61 | 74 69 6f 6e 20 69 73 20 | declara|tion is |
|000034f0| 72 65 6a 65 63 74 65 64 | 20 62 79 20 74 68 65 20 |rejected| by the |
|00003500| 63 6f 6d 70 69 6c 65 72 | 2e 0a 0a 20 20 20 32 2e |compiler|... 2.|
|00003510| 20 45 78 74 65 6e 64 65 | 64 20 70 72 65 63 69 73 | Extende|d precis|
|00003520| 69 6f 6e 20 66 6f 72 20 | 69 6e 69 74 69 61 6c 69 |ion for |initiali|
|00003530| 7a 61 74 69 6f 6e 20 6f | 66 20 66 6c 6f 61 74 69 |zation o|f floati|
|00003540| 6e 67 20 70 6f 69 6e 74 | 2e 20 28 41 64 61 20 38 |ng point|. (Ada 8|
|00003550| 33 0a 20 20 20 20 20 20 | 20 20 20 20 61 6e 64 20 |3. | and |
|00003560| 41 64 61 20 39 35 29 0a | 20 20 20 20 20 20 20 20 |Ada 95).| |
|00003570| 20 20 43 6f 6d 70 69 6c | 65 72 73 20 61 72 65 20 | Compil|ers are |
|00003580| 72 65 71 75 69 72 65 64 | 20 74 6f 20 65 6d 70 6c |required| to empl|
|00003590| 6f 79 0a 20 20 20 20 20 | 20 20 20 20 20 65 78 74 |oy. | ext|
|000035a0| 65 6e 64 65 64 2d 70 72 | 65 63 69 73 69 6f 6e 2f |ended-pr|ecision/|
|000035b0| 72 61 74 69 6f 6e 61 6c | 2d 61 72 69 74 68 6d 65 |rational|-arithme|
|000035c0| 74 69 63 20 72 6f 75 74 | 69 6e 65 73 20 73 6f 20 |tic rout|ines so |
|000035d0| 74 68 61 74 0a 20 20 20 | 20 20 20 20 20 20 20 66 |that. | f|
|000035e0| 6c 6f 61 74 69 6e 67 20 | 70 6f 69 6e 74 20 76 61 |loating |point va|
|000035f0| 72 69 61 62 6c 65 73 20 | 61 6e 64 20 63 6f 6e 73 |riables |and cons|
|00003600| 74 61 6e 74 73 20 63 61 | 6e 20 62 65 20 63 6f 72 |tants ca|n be cor|
|00003610| 72 65 63 74 6c 79 0a 20 | 20 20 20 20 20 20 20 20 |rectly. | |
|00003620| 20 69 6e 69 74 69 61 6c | 69 7a 65 64 20 74 6f 20 | initial|ized to |
|00003630| 74 68 65 69 72 20 66 75 | 6c 6c 20 70 72 65 63 69 |their fu|ll preci|
|00003640| 73 69 6f 6e 2e 0a 0a 20 | 20 20 33 2e 20 47 65 6e |sion... | 3. Gen|
|00003650| 65 72 69 63 20 70 61 63 | 6b 61 67 65 73 20 61 6e |eric pac|kages an|
|00003660| 64 20 73 75 62 70 72 6f | 67 72 61 6d 73 2e 20 28 |d subpro|grams. (|
|00003670| 41 64 61 20 38 33 20 61 | 6e 64 20 41 64 61 20 39 |Ada 83 a|nd Ada 9|
|00003680| 35 29 0a 20 20 20 20 20 | 20 20 20 20 20 41 6c 67 |5). | Alg|
|00003690| 6f 72 69 74 68 6d 73 20 | 63 61 6e 20 62 65 20 77 |orithms |can be w|
|000036a0| 72 69 74 74 65 6e 20 73 | 6f 20 74 68 61 74 20 74 |ritten s|o that t|
|000036b0| 68 65 79 20 70 65 72 66 | 6f 72 6d 20 6f 6e 20 61 |hey perf|orm on a|
|000036c0| 62 73 74 72 61 63 74 0a | 20 20 20 20 20 20 20 20 |bstract.| |
|000036d0| 20 20 72 65 70 72 65 73 | 65 6e 74 61 74 69 6f 6e | repres|entation|
|000036e0| 73 20 6f 66 20 74 68 65 | 20 64 61 74 61 20 73 74 |s of the| data st|
|000036f0| 72 75 63 74 75 72 65 2e | 20 53 75 70 70 6f 72 74 |ructure.| Support|
|00003700| 20 66 6f 72 20 74 68 69 | 73 20 69 73 0a 20 20 20 | for thi|s is. |
|00003710| 20 20 20 20 20 20 20 70 | 72 6f 76 69 64 65 64 20 | p|rovided |
|00003720| 62 79 20 41 64 61 27 73 | 20 67 65 6e 65 72 69 63 |by Ada's| generic|
|00003730| 20 66 61 63 69 6c 69 74 | 69 65 73 20 28 77 68 61 | facilit|ies (wha|
|00003740| 74 20 43 2b 2b 20 70 72 | 6f 67 72 61 6d 6d 65 72 |t C++ pr|ogrammer|
|00003750| 73 0a 20 20 20 20 20 20 | 20 20 20 20 77 6f 75 6c |s. | woul|
|00003760| 64 20 63 61 6c 6c 20 74 | 65 6d 70 6c 61 74 65 73 |d call t|emplates|
|00003770| 29 2e 0a 0a 20 20 20 34 | 2e 20 55 73 65 72 2d 64 |)... 4|. User-d|
|00003780| 65 66 69 6e 65 64 20 6f | 70 65 72 61 74 6f 72 73 |efined o|perators|
|00003790| 20 61 6e 64 20 6f 76 65 | 72 6c 6f 61 64 65 64 20 | and ove|rloaded |
|000037a0| 73 75 62 70 72 6f 67 72 | 61 6d 73 2e 20 28 41 64 |subprogr|ams. (Ad|
|000037b0| 61 20 38 33 20 61 6e 64 | 20 41 64 61 0a 20 20 20 |a 83 and| Ada. |
|000037c0| 20 20 20 20 20 20 20 39 | 35 29 0a 20 20 20 20 20 | 9|5). |
|000037d0| 20 20 20 20 20 54 68 65 | 20 70 72 6f 67 72 61 6d | The| program|
|000037e0| 6d 65 72 20 63 61 6e 20 | 64 65 66 69 6e 65 20 68 |mer can |define h|
|000037f0| 69 73 20 6f 77 6e 20 6f | 70 65 72 61 74 6f 72 73 |is own o|perators|
|00003800| 20 28 66 75 6e 63 74 69 | 6f 6e 73 20 6c 69 6b 65 | (functi|ons like|
|00003810| 0a 20 20 20 20 20 20 20 | 20 20 20 22 2a 22 2c 20 |. | "*", |
|00003820| 22 2b 22 2c 20 22 61 62 | 73 22 2c 20 22 78 6f 72 |"+", "ab|s", "xor|
|00003830| 22 2c 20 22 6f 72 22 2c | 20 65 74 63 2e 29 20 61 |", "or",| etc.) a|
|00003840| 6e 64 20 64 65 66 69 6e | 65 20 61 6e 79 20 6e 75 |nd defin|e any nu|
|00003850| 6d 62 65 72 20 6f 66 0a | 20 20 20 20 20 20 20 20 |mber of.| |
|00003860| 20 20 73 75 62 70 72 6f | 67 72 61 6d 73 20 77 69 | subpro|grams wi|
|00003870| 74 68 20 74 68 65 20 73 | 61 6d 65 20 6e 61 6d 65 |th the s|ame name|
|00003880| 20 28 70 72 6f 76 69 64 | 65 64 20 74 68 65 79 20 | (provid|ed they |
|00003890| 68 61 76 65 20 64 69 66 | 66 65 72 65 6e 74 0a 20 |have dif|ferent. |
|000038a0| 20 20 20 20 20 20 20 20 | 20 61 72 67 75 6d 65 6e | | argumen|
|000038b0| 74 20 70 72 6f 66 69 6c | 65 73 29 2e 0a 0a 20 20 |t profil|es)... |
|000038c0| 20 35 2e 20 4d 75 6c 74 | 69 74 61 73 6b 69 6e 67 | 5. Mult|itasking|
|000038d0| 2e 20 28 41 64 61 20 38 | 33 20 61 6e 64 20 41 64 |. (Ada 8|3 and Ad|
|000038e0| 61 20 39 35 29 0a 20 20 | 20 20 20 20 20 20 20 20 |a 95). | |
|000038f0| 41 64 61 20 66 61 63 69 | 6c 69 74 69 65 73 20 66 |Ada faci|lities f|
|00003900| 6f 72 20 63 6f 6e 63 75 | 72 72 65 6e 74 20 70 72 |or concu|rrent pr|
|00003910| 6f 67 72 61 6d 6d 69 6e | 67 20 28 6d 75 6c 74 69 |ogrammin|g (multi|
|00003920| 74 61 73 6b 69 6e 67 29 | 20 68 61 76 65 0a 20 20 |tasking)| have. |
|00003930| 20 20 20 20 20 20 20 20 | 74 72 61 64 69 74 69 6f | |traditio|
|00003940| 6e 61 6c 6c 79 20 66 6f | 75 6e 64 20 61 70 70 6c |nally fo|und appl|
|00003950| 69 63 61 74 69 6f 6e 20 | 69 6e 20 73 69 6d 75 6c |ication |in simul|
|00003960| 61 74 69 6f 6e 73 20 61 | 6e 64 0a 20 20 20 20 20 |ations a|nd. |
|00003970| 20 20 20 20 20 64 69 73 | 74 72 69 62 75 74 65 64 | dis|tributed|
|00003980| 2f 70 61 72 61 6c 6c 65 | 6c 20 70 72 6f 67 72 61 |/paralle|l progra|
|00003990| 6d 6d 69 6e 67 2e 20 41 | 64 61 20 74 61 73 6b 69 |mming. A|da taski|
|000039a0| 6e 67 20 69 73 20 61 6e | 20 65 73 70 65 63 69 61 |ng is an| especia|
|000039b0| 6c 6c 79 0a 20 20 20 20 | 20 20 20 20 20 20 75 73 |lly. | us|
|000039c0| 65 66 75 6c 20 69 6e 67 | 72 65 64 69 65 6e 74 20 |eful ing|redient |
|000039d0| 69 6e 20 74 68 65 20 41 | 64 61 20 39 35 20 64 69 |in the A|da 95 di|
|000039e0| 73 74 72 69 62 75 74 65 | 64 20 70 72 6f 67 72 61 |stribute|d progra|
|000039f0| 6d 6d 69 6e 67 20 6d 6f | 64 65 6c 2c 0a 20 20 20 |mming mo|del,. |
|00003a00| 20 20 20 20 20 20 20 61 | 6e 64 20 74 68 65 20 63 | a|nd the c|
|00003a10| 6f 6d 62 69 6e 61 74 69 | 6f 6e 20 6f 66 20 74 68 |ombinati|on of th|
|00003a20| 65 20 74 77 6f 20 6d 61 | 6b 65 73 20 69 74 20 70 |e two ma|kes it p|
|00003a30| 6f 73 73 69 62 6c 65 20 | 74 6f 20 64 65 73 69 67 |ossible |to desig|
|00003a40| 6e 0a 20 20 20 20 20 20 | 20 20 20 20 70 61 72 61 |n. | para|
|00003a50| 6c 6c 65 6c 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |llel app|lication|
|00003a60| 73 20 74 68 61 74 20 68 | 61 76 65 20 61 20 68 69 |s that h|ave a hi|
|00003a70| 67 68 20 64 65 67 72 65 | 65 20 6f 66 20 6f 70 65 |gh degre|e of ope|
|00003a80| 72 61 74 69 6e 67 0a 20 | 20 20 20 20 20 20 20 20 |rating. | |
|00003a90| 20 73 79 73 74 65 6d 20 | 69 6e 64 65 70 65 6e 64 | system |independ|
|00003aa0| 65 6e 63 65 20 61 6e 64 | 20 70 6f 72 74 61 62 69 |ence and| portabi|
|00003ab0| 6c 69 74 79 2e 20 28 4d | 6f 72 65 20 6f 6e 20 74 |lity. (M|ore on t|
|00003ac0| 68 69 73 20 69 6e 20 69 | 74 65 6d 20 36 0a 20 20 |his in i|tem 6. |
|00003ad0| 20 20 20 20 20 20 20 20 | 62 65 6c 6f 77 2e 29 0a | |below.).|
|00003ae0| 0a 20 20 20 36 2e 20 44 | 69 72 65 63 74 20 73 75 |. 6. D|irect su|
|00003af0| 70 70 6f 72 74 20 66 6f | 72 20 64 69 73 74 72 69 |pport fo|r distri|
|00003b00| 62 75 74 65 64 2f 70 61 | 72 61 6c 6c 65 6c 20 63 |buted/pa|rallel c|
|00003b10| 6f 6d 70 75 74 69 6e 67 | 20 69 6e 20 74 68 65 20 |omputing| in the |
|00003b20| 6c 61 6e 67 75 61 67 65 | 2e 0a 20 20 20 20 20 20 |language|.. |
|00003b30| 20 20 20 20 28 41 64 61 | 20 39 35 29 0a 20 20 20 | (Ada| 95). |
|00003b40| 20 20 20 20 20 20 20 41 | 64 61 20 39 35 20 69 73 | A|da 95 is|
|00003b50| 20 70 72 6f 62 61 62 6c | 79 20 74 68 65 20 66 69 | probabl|y the fi|
|00003b60| 72 73 74 20 69 6e 74 65 | 72 6e 61 74 69 6f 6e 61 |rst inte|rnationa|
|00003b70| 6c 6c 79 20 73 74 61 6e | 64 61 72 64 69 7a 65 64 |lly stan|dardized|
|00003b80| 0a 20 20 20 20 20 20 20 | 20 20 20 6c 61 6e 67 75 |. | langu|
|00003b90| 61 67 65 20 74 6f 20 63 | 6f 6d 62 69 6e 65 20 69 |age to c|ombine i|
|00003ba0| 6e 20 74 68 65 20 73 61 | 6d 65 20 64 65 73 69 67 |n the sa|me desig|
|00003bb0| 6e 20 63 6f 6d 70 6c 65 | 74 65 20 66 61 63 69 6c |n comple|te facil|
|00003bc0| 69 74 69 65 73 20 66 6f | 72 0a 20 20 20 20 20 20 |ities fo|r. |
|00003bd0| 20 20 20 20 6d 75 6c 74 | 69 74 61 73 6b 69 6e 67 | mult|itasking|
|00003be0| 20 61 6e 64 20 70 61 72 | 61 6c 6c 65 6c 20 70 72 | and par|allel pr|
|00003bf0| 6f 67 72 61 6d 6d 69 6e | 67 2e 20 43 6f 6d 6d 75 |ogrammin|g. Commu|
|00003c00| 6e 69 63 61 74 69 6f 6e | 20 62 65 74 77 65 65 6e |nication| between|
|00003c10| 0a 20 20 20 20 20 20 20 | 20 20 20 74 68 65 20 64 |. | the d|
|00003c20| 69 73 74 72 69 62 75 74 | 65 64 20 70 61 72 74 69 |istribut|ed parti|
|00003c30| 74 69 6f 6e 73 20 69 73 | 20 76 69 61 20 73 79 6e |tions is| via syn|
|00003c40| 63 68 72 6f 6e 6f 75 73 | 20 61 6e 64 20 61 73 79 |chronous| and asy|
|00003c50| 6e 63 68 72 6f 6e 6f 75 | 73 0a 20 20 20 20 20 20 |nchronou|s. |
|00003c60| 20 20 20 20 72 65 6d 6f | 74 65 20 70 72 6f 63 65 | remo|te proce|
|00003c70| 64 75 72 65 20 63 61 6c | 6c 73 2e 0a 0a 20 20 20 |dure cal|ls... |
|00003c80| 20 20 20 20 20 20 20 47 | 6f 6f 64 20 64 69 73 63 | G|ood disc|
|00003c90| 75 73 73 69 6f 6e 2c 20 | 61 6c 6f 6e 67 20 77 69 |ussion, |along wi|
|00003ca0| 74 68 20 63 6f 64 65 20 | 65 78 61 6d 70 6c 65 73 |th code |examples|
|00003cb0| 2c 20 69 73 20 66 6f 75 | 6e 64 20 69 6e 20 74 68 |, is fou|nd in th|
|00003cc0| 65 0a 20 20 20 20 20 20 | 20 20 20 20 52 61 74 69 |e. | Rati|
|00003cd0| 6f 6e 61 6c 65 2c 20 50 | 61 72 74 20 49 49 49 20 |onale, P|art III |
|00003ce0| 45 2c 20 61 6e 64 20 69 | 6e 20 74 68 65 20 41 64 |E, and i|n the Ad|
|00003cf0| 61 20 39 35 20 52 65 66 | 65 72 65 6e 63 65 20 4d |a 95 Ref|erence M|
|00003d00| 61 6e 75 61 6c 2c 0a 20 | 20 20 20 20 20 20 20 20 |anual,. | |
|00003d10| 20 41 6e 6e 65 78 20 45 | 2e 20 53 65 65 20 61 6c | Annex E|. See al|
|00003d20| 73 6f 20 22 41 64 61 20 | 4c 65 74 74 65 72 73 22 |so "Ada |Letters"|
|00003d30| 2c 20 56 6f 6c 2e 20 31 | 33 2c 20 4e 6f 2e 20 32 |, Vol. 1|3, No. 2|
|00003d40| 20 28 31 39 39 33 29 2c | 20 70 70 2e 20 35 34 0a | (1993),| pp. 54.|
|00003d50| 20 20 20 20 20 20 20 20 | 20 20 61 6e 64 20 37 38 | | and 78|
|00003d60| 2c 20 61 6e 64 20 56 6f | 6c 2e 20 31 34 2c 20 4e |, and Vo|l. 14, N|
|00003d70| 6f 2e 20 32 20 28 31 39 | 39 34 29 2c 20 70 2e 20 |o. 2 (19|94), p. |
|00003d80| 38 30 2e 20 28 46 75 6c | 6c 20 73 75 70 70 6f 72 |80. (Ful|l suppor|
|00003d90| 74 20 66 6f 72 0a 20 20 | 20 20 20 20 20 20 20 20 |t for. | |
|00003da0| 74 68 65 73 65 20 66 65 | 61 74 75 72 65 73 20 69 |these fe|atures i|
|00003db0| 73 20 70 72 6f 76 69 64 | 65 64 20 62 79 20 63 6f |s provid|ed by co|
|00003dc0| 6d 70 69 6c 65 72 73 20 | 74 68 61 74 20 63 6f 6e |mpilers |that con|
|00003dd0| 66 6f 72 6d 20 74 6f 20 | 74 68 65 20 41 64 61 0a |form to |the Ada.|
|00003de0| 20 20 20 20 20 20 20 20 | 20 20 39 35 20 64 69 73 | | 95 dis|
|00003df0| 74 72 69 62 75 74 65 64 | 20 63 6f 6d 70 75 74 69 |tributed| computi|
|00003e00| 6e 67 20 41 6e 6e 65 78 | 2e 20 54 68 69 73 20 63 |ng Annex|. This c|
|00003e10| 6f 6e 66 6f 72 6d 61 6e | 63 65 20 69 73 20 6f 70 |onforman|ce is op|
|00003e20| 74 69 6f 6e 61 6c 2c 0a | 20 20 20 20 20 20 20 20 |tional,.| |
|00003e30| 20 20 62 75 74 20 66 6f | 72 20 69 6e 73 74 61 6e | but fo|r instan|
|00003e40| 63 65 20 47 4e 41 54 2c | 20 74 68 65 20 47 6e 75 |ce GNAT,| the Gnu|
|00003e50| 20 41 64 61 20 39 35 20 | 63 6f 6d 70 69 6c 65 72 | Ada 95 |compiler|
|00003e60| 2c 20 77 69 6c 6c 20 6d | 65 65 74 20 74 68 65 73 |, will m|eet thes|
|00003e70| 65 0a 20 20 20 20 20 20 | 20 20 20 20 72 65 71 75 |e. | requ|
|00003e80| 69 72 65 6d 65 6e 74 73 | 2e 29 0a 0a 20 20 20 37 |irements|.).. 7|
|00003e90| 2e 20 41 74 74 72 69 62 | 75 74 65 73 20 6f 66 20 |. Attrib|utes of |
|00003ea0| 66 6c 6f 61 74 69 6e 67 | 20 70 6f 69 6e 74 20 74 |floating| point t|
|00003eb0| 79 70 65 73 2e 20 28 41 | 64 61 20 38 33 20 61 6e |ypes. (A|da 83 an|
|00003ec0| 64 20 41 64 61 20 39 35 | 29 0a 20 20 20 20 20 20 |d Ada 95|). |
|00003ed0| 20 20 20 20 46 6f 72 20 | 65 76 65 72 79 20 66 6c | For |every fl|
|00003ee0| 6f 61 74 69 6e 67 20 70 | 6f 69 6e 74 20 74 79 70 |oating p|oint typ|
|00003ef0| 65 20 28 69 6e 63 6c 75 | 64 69 6e 67 20 75 73 65 |e (inclu|ding use|
|00003f00| 72 20 64 65 66 69 6e 65 | 64 20 74 79 70 65 73 29 |r define|d types)|
|00003f10| 2c 0a 20 20 20 20 20 20 | 20 20 20 20 74 68 65 72 |,. | ther|
|00003f20| 65 20 61 72 65 20 62 75 | 69 6c 74 2d 69 6e 20 66 |e are bu|ilt-in f|
|00003f30| 75 6e 63 74 69 6f 6e 73 | 20 74 68 61 74 20 72 65 |unctions| that re|
|00003f40| 74 75 72 6e 20 74 68 65 | 20 65 73 73 65 6e 74 69 |turn the| essenti|
|00003f50| 61 6c 0a 20 20 20 20 20 | 20 20 20 20 20 63 68 61 |al. | cha|
|00003f60| 72 61 63 74 65 72 69 73 | 74 69 63 73 20 6f 66 20 |racteris|tics of |
|00003f70| 74 68 65 20 74 79 70 65 | 2e 20 46 6f 72 20 65 78 |the type|. For ex|
|00003f80| 61 6d 70 6c 65 2c 20 69 | 66 20 79 6f 75 20 64 65 |ample, i|f you de|
|00003f90| 63 6c 61 72 65 20 22 74 | 79 70 65 0a 20 20 20 20 |clare "t|ype. |
|00003fa0| 20 20 20 20 20 20 52 65 | 61 6c 20 69 73 20 64 69 | Re|al is di|
|00003fb0| 67 69 74 73 20 31 35 22 | 20 74 68 65 6e 20 79 6f |gits 15"| then yo|
|00003fc0| 75 20 63 61 6e 20 67 65 | 74 20 74 68 65 20 6d 61 |u can ge|t the ma|
|00003fd0| 78 20 65 78 70 6f 6e 65 | 6e 74 20 6f 66 20 6f 62 |x expone|nt of ob|
|00003fe0| 6a 65 63 74 73 0a 20 20 | 20 20 20 20 20 20 20 20 |jects. | |
|00003ff0| 6f 66 20 74 79 70 65 20 | 52 65 61 6c 20 66 72 6f |of type |Real fro|
|00004000| 6d 20 52 65 61 6c 27 4d | 61 63 68 69 6e 65 5f 45 |m Real'M|achine_E|
|00004010| 6d 61 78 2e 20 53 69 6d | 69 6c 61 72 6c 79 2c 20 |max. Sim|ilarly, |
|00004020| 74 68 65 20 73 69 7a 65 | 20 6f 66 20 74 68 65 0a |the size| of the.|
|00004030| 20 20 20 20 20 20 20 20 | 20 20 4d 61 6e 74 69 73 | | Mantis|
|00004040| 73 61 2c 20 74 68 65 20 | 52 61 64 69 78 2c 20 74 |sa, the |Radix, t|
|00004050| 68 65 20 6c 61 72 67 65 | 73 74 20 52 65 61 6c 2c |he large|st Real,|
|00004060| 20 61 6e 64 20 74 68 65 | 20 52 6f 75 6e 64 69 6e | and the| Roundin|
|00004070| 67 20 70 6f 6c 69 63 79 | 0a 20 20 20 20 20 20 20 |g policy|. |
|00004080| 20 20 20 6f 66 20 74 68 | 65 20 61 72 69 74 68 6d | of th|e arithm|
|00004090| 65 74 69 63 20 61 72 65 | 20 67 69 76 65 6e 20 62 |etic are| given b|
|000040a0| 79 20 52 65 61 6c 27 4d | 61 63 68 69 6e 65 5f 4d |y Real'M|achine_M|
|000040b0| 61 6e 74 69 73 73 61 2c | 0a 20 20 20 20 20 20 20 |antissa,|. |
|000040c0| 20 20 20 52 65 61 6c 27 | 4d 61 63 68 69 6e 65 5f | Real'|Machine_|
|000040d0| 52 61 64 69 78 2c 20 52 | 65 61 6c 27 4c 61 73 74 |Radix, R|eal'Last|
|000040e0| 2c 20 61 6e 64 20 52 65 | 61 6c 27 4d 61 63 68 69 |, and Re|al'Machi|
|000040f0| 6e 65 5f 52 6f 75 6e 64 | 73 2e 20 54 68 65 72 65 |ne_Round|s. There|
|00004100| 0a 20 20 20 20 20 20 20 | 20 20 20 61 72 65 20 6d |. | are m|
|00004110| 61 6e 79 20 6f 74 68 65 | 72 73 2e 0a 0a 20 20 20 |any othe|rs... |
|00004120| 20 20 20 20 20 20 20 28 | 53 65 65 20 41 64 61 20 | (|See Ada |
|00004130| 39 35 20 52 65 66 65 72 | 65 6e 63 65 20 4d 61 6e |95 Refer|ence Man|
|00004140| 75 61 6c 2c 20 63 6c 61 | 75 73 65 20 33 2e 35 2c |ual, cla|use 3.5,|
|00004150| 20 73 75 62 63 6c 61 75 | 73 65 20 33 2e 35 2e 38 | subclau|se 3.5.8|
|00004160| 20 61 6e 64 0a 20 20 20 | 20 20 20 20 20 20 20 41 | and. | A|
|00004170| 2e 35 2e 33 2c 20 61 73 | 20 77 65 6c 6c 20 61 73 |.5.3, as| well as|
|00004180| 20 50 61 72 74 20 49 49 | 49 20 73 65 63 74 69 6f | Part II|I sectio|
|00004190| 6e 73 20 47 2e 32 20 61 | 6e 64 20 47 2e 34 2e 31 |ns G.2 a|nd G.4.1|
|000041a0| 20 6f 66 20 74 68 65 20 | 41 64 61 20 39 35 0a 20 | of the |Ada 95. |
|000041b0| 20 20 20 20 20 20 20 20 | 20 52 61 74 69 6f 6e 61 | | Rationa|
|000041c0| 6c 65 2e 29 0a 0a 20 20 | 20 38 2e 20 41 74 74 72 |le.).. | 8. Attr|
|000041d0| 69 62 75 74 65 20 66 75 | 6e 63 74 69 6f 6e 73 20 |ibute fu|nctions |
|000041e0| 66 6f 72 20 66 6c 6f 61 | 74 69 6e 67 20 70 6f 69 |for floa|ting poi|
|000041f0| 6e 74 20 74 79 70 65 73 | 2e 20 28 41 64 61 20 39 |nt types|. (Ada 9|
|00004200| 35 29 0a 20 20 20 20 20 | 20 20 20 20 20 46 6f 72 |5). | For|
|00004210| 20 65 76 65 72 79 20 66 | 6c 6f 61 74 69 6e 67 20 | every f|loating |
|00004220| 70 6f 69 6e 74 20 74 79 | 70 65 20 28 69 6e 63 6c |point ty|pe (incl|
|00004230| 75 64 69 6e 67 20 75 73 | 65 72 20 64 65 66 69 6e |uding us|er defin|
|00004240| 65 64 20 74 79 70 65 73 | 29 2c 0a 20 20 20 20 20 |ed types|),. |
|00004250| 20 20 20 20 20 74 68 65 | 72 65 20 61 72 65 20 62 | the|re are b|
|00004260| 75 69 6c 74 2d 69 6e 20 | 66 75 6e 63 74 69 6f 6e |uilt-in |function|
|00004270| 73 20 74 68 61 74 20 6f | 70 65 72 61 74 65 20 6f |s that o|perate o|
|00004280| 6e 20 6f 62 6a 65 63 74 | 73 20 6f 66 20 74 68 61 |n object|s of tha|
|00004290| 74 0a 20 20 20 20 20 20 | 20 20 20 20 74 79 70 65 |t. | type|
|000042a0| 2e 20 46 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 69 |. For ex|ample, i|
|000042b0| 66 20 79 6f 75 20 64 65 | 63 6c 61 72 65 20 22 74 |f you de|clare "t|
|000042c0| 79 70 65 20 52 65 61 6c | 20 69 73 20 64 69 67 69 |ype Real| is digi|
|000042d0| 74 73 20 31 35 22 20 74 | 68 65 6e 0a 20 20 20 20 |ts 15" t|hen. |
|000042e0| 20 20 20 20 20 20 52 65 | 61 6c 27 52 65 6d 61 69 | Re|al'Remai|
|000042f0| 6e 64 65 72 20 28 58 2c | 20 59 29 20 72 65 74 75 |nder (X,| Y) retu|
|00004300| 72 6e 73 20 74 68 65 20 | 65 78 61 63 74 20 72 65 |rns the |exact re|
|00004310| 6d 61 69 6e 64 65 72 20 | 6f 66 20 58 20 61 6e 64 |mainder |of X and|
|00004320| 20 59 3a 20 58 0a 20 20 | 20 20 20 20 20 20 20 20 | Y: X. | |
|00004330| 2d 20 6e 2a 59 20 77 68 | 65 72 65 20 6e 20 69 73 |- n*Y wh|ere n is|
|00004340| 20 74 68 65 20 69 6e 74 | 65 67 65 72 20 6e 65 61 | the int|eger nea|
|00004350| 72 65 73 74 20 58 2f 59 | 2e 20 52 65 61 6c 27 54 |rest X/Y|. Real'T|
|00004360| 72 75 6e 63 61 74 69 6f | 6e 28 58 29 2c 0a 20 20 |runcatio|n(X),. |
|00004370| 20 20 20 20 20 20 20 20 | 52 65 61 6c 27 4d 61 78 | |Real'Max|
|00004380| 28 58 2c 59 29 2c 20 52 | 65 61 6c 27 52 6f 75 6e |(X,Y), R|eal'Roun|
|00004390| 64 69 6e 67 28 58 29 20 | 68 61 76 65 20 74 68 65 |ding(X) |have the|
|000043a0| 20 75 73 75 61 6c 20 6d | 65 61 6e 69 6e 67 73 2e | usual m|eanings.|
|000043b0| 0a 20 20 20 20 20 20 20 | 20 20 20 52 65 61 6c 27 |. | Real'|
|000043c0| 46 72 61 63 74 69 6f 6e | 28 58 29 20 61 6e 64 20 |Fraction|(X) and |
|000043d0| 52 65 61 6c 27 45 78 70 | 6f 6e 65 6e 74 28 58 29 |Real'Exp|onent(X)|
|000043e0| 20 62 72 65 61 6b 20 58 | 20 69 6e 74 6f 20 6d 61 | break X| into ma|
|000043f0| 6e 74 69 73 73 61 20 61 | 6e 64 0a 20 20 20 20 20 |ntissa a|nd. |
|00004400| 20 20 20 20 20 65 78 70 | 6f 6e 65 6e 74 3b 20 52 | exp|onent; R|
|00004410| 65 61 6c 27 53 63 61 6c | 69 6e 67 28 58 2c 20 4e |eal'Scal|ing(X, N|
|00004420| 29 20 69 73 20 65 78 61 | 63 74 20 73 63 61 6c 69 |) is exa|ct scali|
|00004430| 6e 67 3a 20 6d 75 6c 74 | 69 70 6c 69 65 73 20 58 |ng: mult|iplies X|
|00004440| 20 62 79 0a 20 20 20 20 | 20 20 20 20 20 20 52 61 | by. | Ra|
|00004450| 64 69 78 2a 2a 4e 2c 20 | 77 68 69 63 68 20 63 61 |dix**N, |which ca|
|00004460| 6e 20 62 65 20 64 6f 6e | 65 20 62 79 20 69 6e 63 |n be don|e by inc|
|00004470| 72 65 6d 65 6e 74 69 6e | 67 20 74 68 65 20 65 78 |rementin|g the ex|
|00004480| 70 6f 6e 65 6e 74 20 62 | 79 20 4e 2c 0a 20 20 20 |ponent b|y N,. |
|00004490| 20 20 20 20 20 20 20 65 | 74 63 2e 20 28 53 65 65 | e|tc. (See|
|000044a0| 20 63 69 74 61 74 69 6f | 6e 73 20 69 6e 20 69 74 | citatio|ns in it|
|000044b0| 65 6d 20 37 2e 29 0a 0a | 20 20 20 39 2e 20 4d 6f |em 7.)..| 9. Mo|
|000044c0| 64 75 6c 61 72 20 61 72 | 69 74 68 6d 65 74 69 63 |dular ar|ithmetic|
|000044d0| 20 6f 6e 20 69 6e 74 65 | 67 65 72 20 74 79 70 65 | on inte|ger type|
|000044e0| 73 2e 20 28 41 64 61 20 | 39 35 29 0a 20 20 20 20 |s. (Ada |95). |
|000044f0| 20 20 20 20 20 20 49 66 | 20 79 6f 75 20 64 65 63 | If| you dec|
|00004500| 6c 61 72 65 20 22 74 79 | 70 65 20 4d 79 5f 55 6e |lare "ty|pe My_Un|
|00004510| 73 69 67 6e 65 64 20 69 | 73 20 6d 6f 64 20 4e 22 |signed i|s mod N"|
|00004520| 2c 20 66 6f 72 20 61 72 | 62 69 74 72 61 72 79 20 |, for ar|bitrary |
|00004530| 4e 2c 0a 20 20 20 20 20 | 20 20 20 20 20 74 68 65 |N,. | the|
|00004540| 6e 20 61 72 69 74 68 6d | 65 74 69 63 20 28 22 2a |n arithm|etic ("*|
|00004550| 22 2c 20 22 2b 22 2c 20 | 65 74 63 2e 29 20 6f 6e |", "+", |etc.) on|
|00004560| 20 6f 62 6a 65 63 74 73 | 20 6f 66 20 74 79 70 65 | objects| of type|
|00004570| 20 4d 79 5f 55 6e 73 69 | 67 6e 65 64 0a 20 20 20 | My_Unsi|gned. |
|00004580| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 73 20 74 | r|eturns t|
|00004590| 68 65 20 72 65 73 75 6c | 74 73 20 6d 6f 64 75 6c |he resul|ts modul|
|000045a0| 6f 20 4e 2e 20 42 6f 6f | 6c 65 61 6e 20 6f 70 65 |o N. Boo|lean ope|
|000045b0| 72 61 74 6f 72 73 20 22 | 61 6e 64 22 2c 20 22 6f |rators "|and", "o|
|000045c0| 72 22 2c 0a 20 20 20 20 | 20 20 20 20 20 20 22 78 |r",. | "x|
|000045d0| 6f 72 22 2c 20 61 6e 64 | 20 22 6e 6f 74 22 20 61 |or", and| "not" a|
|000045e0| 72 65 20 64 65 66 69 6e | 65 64 20 6f 6e 20 74 68 |re defin|ed on th|
|000045f0| 65 20 6f 62 6a 65 63 74 | 73 20 61 73 20 74 68 6f |e object|s as tho|
|00004600| 75 67 68 20 74 68 65 79 | 20 77 65 72 65 0a 20 20 |ugh they| were. |
|00004610| 20 20 20 20 20 20 20 20 | 61 72 72 61 79 73 20 6f | |arrays o|
|00004620| 66 20 62 69 74 73 20 28 | 61 6e 64 20 6c 69 6b 65 |f bits (|and like|
|00004630| 77 69 73 65 20 72 65 74 | 75 72 6e 20 72 65 73 75 |wise ret|urn resu|
|00004640| 6c 74 73 20 6d 6f 64 75 | 6c 6f 20 4e 29 2e 20 46 |lts modu|lo N). F|
|00004650| 6f 72 20 4e 20 61 0a 20 | 20 20 20 20 20 20 20 20 |or N a. | |
|00004660| 20 70 6f 77 65 72 20 6f | 66 20 32 2c 20 74 68 65 | power o|f 2, the|
|00004670| 20 73 65 6d 61 6e 74 69 | 63 73 20 61 72 65 20 73 | semanti|cs are s|
|00004680| 69 6d 69 6c 61 72 20 74 | 6f 20 74 68 6f 73 65 20 |imilar t|o those |
|00004690| 6f 66 20 43 20 75 6e 73 | 69 67 6e 65 64 0a 20 20 |of C uns|igned. |
|000046a0| 20 20 20 20 20 20 20 20 | 74 79 70 65 73 2e 0a 0a | |types...|
|000046b0| 20 20 20 31 30 2e 20 47 | 65 6e 65 72 69 63 20 65 | 10. G|eneric e|
|000046c0| 6c 65 6d 65 6e 74 61 72 | 79 20 6d 61 74 68 20 66 |lementar|y math f|
|000046d0| 75 6e 63 74 69 6f 6e 73 | 20 66 6f 72 20 66 6c 6f |unctions| for flo|
|000046e0| 61 74 69 6e 67 20 70 6f | 69 6e 74 20 74 79 70 65 |ating po|int type|
|000046f0| 73 2e 20 28 41 64 61 0a | 20 20 20 20 20 20 20 20 |s. (Ada.| |
|00004700| 20 20 39 35 29 0a 20 20 | 20 20 20 20 20 20 20 20 | 95). | |
|00004710| 52 65 71 75 69 72 65 64 | 20 6f 66 20 61 6c 6c 20 |Required| of all |
|00004720| 63 6f 6d 70 69 6c 65 72 | 73 2c 20 61 6e 64 20 70 |compiler|s, and p|
|00004730| 72 6f 76 69 64 65 64 20 | 66 6f 72 20 61 6e 79 20 |rovided |for any |
|00004740| 66 6c 6f 61 74 69 6e 67 | 20 70 6f 69 6e 74 0a 20 |floating| point. |
|00004750| 20 20 20 20 20 20 20 20 | 20 74 79 70 65 3a 20 53 | | type: S|
|00004760| 71 72 74 2c 20 43 6f 73 | 2c 20 53 69 6e 2c 20 54 |qrt, Cos|, Sin, T|
|00004770| 61 6e 2c 20 43 6f 74 2c | 20 45 78 70 2c 20 53 69 |an, Cot,| Exp, Si|
|00004780| 6e 68 2c 20 43 6f 73 68 | 2c 20 54 61 6e 68 2c 20 |nh, Cosh|, Tanh, |
|00004790| 43 6f 74 68 2c 0a 20 20 | 20 20 20 20 20 20 20 20 |Coth,. | |
|000047a0| 61 6e 64 20 74 68 65 20 | 69 6e 76 65 72 73 65 20 |and the |inverse |
|000047b0| 66 75 6e 63 74 69 6f 6e | 73 20 6f 66 20 65 61 63 |function|s of eac|
|000047c0| 68 20 6f 66 20 74 68 65 | 73 65 2c 20 41 72 63 74 |h of the|se, Arct|
|000047d0| 61 6e 2c 20 4c 6f 67 2c | 0a 20 20 20 20 20 20 20 |an, Log,|. |
|000047e0| 20 20 20 41 72 63 73 69 | 6e 68 2c 20 65 74 63 2e | Arcsi|nh, etc.|
|000047f0| 20 41 6c 73 6f 2c 20 58 | 2a 2a 59 20 66 6f 72 20 | Also, X|**Y for |
|00004800| 66 6c 6f 61 74 69 6e 67 | 20 70 6f 69 6e 74 20 58 |floating| point X|
|00004810| 20 61 6e 64 20 59 2e 20 | 43 6f 6d 70 69 6c 65 72 | and Y. |Compiler|
|00004820| 73 0a 20 20 20 20 20 20 | 20 20 20 20 74 68 61 74 |s. | that|
|00004830| 20 63 6f 6e 66 6f 72 6d | 20 74 6f 20 74 68 65 20 | conform| to the |
|00004840| 4e 75 6d 65 72 69 63 73 | 20 41 6e 6e 65 78 20 6d |Numerics| Annex m|
|00004850| 65 65 74 20 61 64 64 69 | 74 69 6f 6e 61 6c 20 61 |eet addi|tional a|
|00004860| 63 63 75 72 61 63 79 0a | 20 20 20 20 20 20 20 20 |ccuracy.| |
|00004870| 20 20 72 65 71 75 69 72 | 65 6d 65 6e 74 73 2e 0a | requir|ements..|
|00004880| 0a 20 20 20 20 20 20 20 | 20 20 20 28 53 65 65 20 |. | (See |
|00004890| 73 75 62 63 6c 61 75 73 | 65 20 41 2e 35 2e 31 20 |subclaus|e A.5.1 |
|000048a0| 6f 66 20 74 68 65 20 41 | 64 61 20 39 35 20 52 4d |of the A|da 95 RM|
|000048b0| 2c 20 61 6e 64 20 50 61 | 72 74 20 49 49 49 2c 20 |, and Pa|rt III, |
|000048c0| 53 65 63 74 69 6f 6e 0a | 20 20 20 20 20 20 20 20 |Section.| |
|000048d0| 20 20 41 2e 33 20 6f 66 | 20 74 68 65 20 41 64 61 | A.3 of| the Ada|
|000048e0| 20 39 35 20 52 61 74 69 | 6f 6e 61 6c 65 2e 29 0a | 95 Rati|onale.).|
|000048f0| 0a 20 20 20 31 31 2e 20 | 43 6f 6d 70 6c 65 78 20 |. 11. |Complex |
|00004900| 6e 75 6d 62 65 72 73 2e | 20 28 41 64 61 20 39 35 |numbers.| (Ada 95|
|00004910| 29 0a 20 20 20 20 20 20 | 20 20 20 20 46 6f 72 74 |). | Fort|
|00004920| 72 61 6e 2d 6c 69 6b 65 | 2c 20 62 75 74 20 77 69 |ran-like|, but wi|
|00004930| 74 68 20 61 20 6e 65 77 | 20 74 79 70 65 20 63 61 |th a new| type ca|
|00004940| 6c 6c 65 64 20 49 6d 61 | 67 69 6e 61 72 79 2e 20 |lled Ima|ginary. |
|00004950| 54 79 70 65 0a 20 20 20 | 20 20 20 20 20 20 20 22 |Type. | "|
|00004960| 49 6d 61 67 69 6e 61 72 | 79 22 20 61 6c 6c 6f 77 |Imaginar|y" allow|
|00004970| 73 20 70 72 6f 67 72 61 | 6d 6d 65 72 73 20 74 6f |s progra|mmers to|
|00004980| 20 77 72 69 74 65 20 65 | 78 70 72 65 73 73 69 6f | write e|xpressio|
|00004990| 6e 73 20 69 6e 20 73 75 | 63 68 20 61 0a 20 20 20 |ns in su|ch a. |
|000049a0| 20 20 20 20 20 20 20 77 | 61 79 20 74 68 61 74 20 | w|ay that |
|000049b0| 74 68 65 79 20 61 72 65 | 20 65 61 73 69 65 72 20 |they are| easier |
|000049c0| 74 6f 20 6f 70 74 69 6d | 69 7a 65 2c 20 6d 6f 72 |to optim|ize, mor|
|000049d0| 65 20 72 65 61 64 61 62 | 6c 65 20 61 6e 64 20 61 |e readab|le and a|
|000049e0| 70 70 65 61 72 0a 20 20 | 20 20 20 20 20 20 20 20 |ppear. | |
|000049f0| 69 6e 20 63 6f 64 65 20 | 61 73 20 74 68 65 79 20 |in code |as they |
|00004a00| 61 70 70 65 61 72 20 6f | 6e 20 70 61 70 65 72 2e |appear o|n paper.|
|00004a10| 20 41 6c 73 6f 2c 20 74 | 68 65 20 61 62 69 6c 69 | Also, t|he abili|
|00004a20| 74 79 20 74 6f 20 64 65 | 63 6c 61 72 65 0a 20 20 |ty to de|clare. |
|00004a30| 20 20 20 20 20 20 20 20 | 6f 62 6a 65 63 74 20 6f | |object o|
|00004a40| 66 20 70 75 72 65 20 69 | 6d 61 67 69 6e 61 72 79 |f pure i|maginary|
|00004a50| 20 74 79 70 65 20 72 65 | 64 75 63 65 73 20 74 68 | type re|duces th|
|00004a60| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 63 61 73 65 |e number| of case|
|00004a70| 73 20 69 6e 0a 20 20 20 | 20 20 20 20 20 20 20 77 |s in. | w|
|00004a80| 68 69 63 68 20 70 72 65 | 6d 61 74 75 72 65 20 74 |hich pre|mature t|
|00004a90| 79 70 65 20 63 6f 6e 76 | 65 72 73 69 6f 6e 20 6f |ype conv|ersion o|
|00004aa0| 66 20 72 65 61 6c 20 6e | 75 6d 62 65 72 73 20 74 |f real n|umbers t|
|00004ab0| 6f 20 63 6f 6d 70 6c 65 | 78 0a 20 20 20 20 20 20 |o comple|x. |
|00004ac0| 20 20 20 20 63 61 75 73 | 65 73 20 66 6c 6f 61 74 | caus|es float|
|00004ad0| 69 6e 67 20 70 6f 69 6e | 74 20 65 78 63 65 70 74 |ing poin|t except|
|00004ae0| 69 6f 6e 73 20 74 6f 20 | 6f 63 63 75 72 2e 20 28 |ions to |occur. (|
|00004af0| 50 72 6f 76 69 64 65 64 | 20 62 79 0a 20 20 20 20 |Provided| by. |
|00004b00| 20 20 20 20 20 20 63 6f | 6d 70 69 6c 65 72 73 20 | co|mpilers |
|00004b10| 74 68 61 74 20 63 6f 6e | 66 6f 72 6d 20 74 6f 20 |that con|form to |
|00004b20| 74 68 65 20 4e 75 6d 65 | 72 69 63 73 20 41 6e 6e |the Nume|rics Ann|
|00004b30| 65 78 2e 20 54 68 65 20 | 47 6e 75 20 41 64 61 20 |ex. The |Gnu Ada |
|00004b40| 39 35 0a 20 20 20 20 20 | 20 20 20 20 20 63 6f 6d |95. | com|
|00004b50| 70 69 6c 65 72 20 73 75 | 70 70 6f 72 74 73 20 74 |piler su|pports t|
|00004b60| 68 69 73 20 61 6e 6e 65 | 78 2c 20 73 6f 20 74 68 |his anne|x, so th|
|00004b70| 65 20 73 6f 75 72 63 65 | 20 63 6f 64 65 20 69 73 |e source| code is|
|00004b80| 20 66 72 65 65 6c 79 0a | 20 20 20 20 20 20 20 20 | freely.| |
|00004b90| 20 20 61 76 61 69 6c 61 | 62 6c 65 2e 29 0a 0a 20 | availa|ble.).. |
|00004ba0| 20 20 31 32 2e 20 47 65 | 6e 65 72 69 63 20 65 6c | 12. Ge|neric el|
|00004bb0| 65 6d 65 6e 74 61 72 79 | 20 6d 61 74 68 20 66 75 |ementary| math fu|
|00004bc0| 6e 63 74 69 6f 6e 73 20 | 66 6f 72 20 63 6f 6d 70 |nctions |for comp|
|00004bd0| 6c 65 78 20 6e 75 6d 62 | 65 72 20 74 79 70 65 73 |lex numb|er types|
|00004be0| 2e 20 28 41 64 61 0a 20 | 20 20 20 20 20 20 20 20 |. (Ada. | |
|00004bf0| 20 39 35 29 0a 20 20 20 | 20 20 20 20 20 20 20 53 | 95). | S|
|00004c00| 61 6d 65 20 66 75 6e 63 | 74 69 6f 6e 73 20 73 75 |ame func|tions su|
|00004c10| 70 70 6f 72 74 65 64 20 | 66 6f 72 20 72 65 61 6c |pported |for real|
|00004c20| 20 74 79 70 65 73 2c 20 | 62 75 74 20 77 69 74 68 | types, |but with|
|00004c30| 20 63 6f 6d 70 6c 65 78 | 0a 20 20 20 20 20 20 20 | complex|. |
|00004c40| 20 20 20 61 72 67 75 6d | 65 6e 74 73 2e 20 53 74 | argum|ents. St|
|00004c50| 61 6e 64 61 72 64 20 49 | 4f 20 69 73 20 70 72 6f |andard I|O is pro|
|00004c60| 76 69 64 65 64 20 66 6f | 72 20 66 6c 6f 61 74 69 |vided fo|r floati|
|00004c70| 6e 67 20 70 6f 69 6e 74 | 20 74 79 70 65 73 20 61 |ng point| types a|
|00004c80| 6e 64 0a 20 20 20 20 20 | 20 20 20 20 20 43 6f 6d |nd. | Com|
|00004c90| 70 6c 65 78 20 74 79 70 | 65 73 2e 20 28 4f 6e 6c |plex typ|es. (Onl|
|00004ca0| 79 20 72 65 71 75 69 72 | 65 64 20 6f 66 20 63 6f |y requir|ed of co|
|00004cb0| 6d 70 69 6c 65 72 73 20 | 74 68 61 74 20 73 75 70 |mpilers |that sup|
|00004cc0| 70 6f 72 74 20 74 68 65 | 0a 20 20 20 20 20 20 20 |port the|. |
|00004cd0| 20 20 20 4e 75 6d 65 72 | 69 63 73 20 41 6e 6e 65 | Numer|ics Anne|
|00004ce0| 78 2c 20 6c 69 6b 65 20 | 47 6e 75 20 41 64 61 2e |x, like |Gnu Ada.|
|00004cf0| 29 0a 0a 20 20 20 31 33 | 2e 20 50 73 65 75 64 6f |).. 13|. Pseudo|
|00004d00| 2d 72 61 6e 64 6f 6d 20 | 6e 75 6d 62 65 72 73 20 |-random |numbers |
|00004d10| 66 6f 72 20 64 69 73 63 | 72 65 74 65 20 61 6e 64 |for disc|rete and|
|00004d20| 20 66 6c 6f 61 74 69 6e | 67 20 70 6f 69 6e 74 20 | floatin|g point |
|00004d30| 74 79 70 65 73 2e 20 28 | 41 64 61 0a 20 20 20 20 |types. (|Ada. |
|00004d40| 20 20 20 20 20 20 39 35 | 29 0a 20 20 20 20 20 20 | 95|). |
|00004d50| 20 20 20 20 41 20 66 6c | 6f 61 74 69 6e 67 20 70 | A fl|oating p|
|00004d60| 6f 69 6e 74 20 70 73 65 | 75 64 6f 2d 72 61 6e 64 |oint pse|udo-rand|
|00004d70| 6f 6d 20 6e 75 6d 62 65 | 72 20 67 65 6e 65 72 61 |om numbe|r genera|
|00004d80| 74 6f 72 20 28 50 52 4e | 47 29 20 70 72 6f 76 69 |tor (PRN|G) provi|
|00004d90| 64 65 73 0a 20 20 20 20 | 20 20 20 20 20 20 6f 75 |des. | ou|
|00004da0| 74 70 75 74 20 69 6e 20 | 74 68 65 20 72 61 6e 67 |tput in |the rang|
|00004db0| 65 20 30 2e 30 20 2e 2e | 20 31 2e 30 2e 20 44 69 |e 0.0 ..| 1.0. Di|
|00004dc0| 73 63 72 65 74 65 3a 20 | 41 20 67 65 6e 65 72 69 |screte: |A generi|
|00004dd0| 63 20 50 52 4e 47 0a 20 | 20 20 20 20 20 20 20 20 |c PRNG. | |
|00004de0| 20 70 61 63 6b 61 67 65 | 20 69 73 20 70 72 6f 76 | package| is prov|
|00004df0| 69 64 65 64 20 74 68 61 | 74 20 63 61 6e 20 62 65 |ided tha|t can be|
|00004e00| 20 69 6e 73 74 61 6e 74 | 69 61 74 65 64 20 77 69 | instant|iated wi|
|00004e10| 74 68 20 61 6e 79 20 64 | 69 73 63 72 65 74 65 0a |th any d|iscrete.|
|00004e20| 20 20 20 20 20 20 20 20 | 20 20 74 79 70 65 3a 20 | | type: |
|00004e30| 42 6f 6f 6c 65 61 6e 2c | 20 49 6e 74 65 67 65 72 |Boolean,| Integer|
|00004e40| 2c 20 4d 6f 64 75 6c 61 | 72 20 65 74 63 2e 20 54 |, Modula|r etc. T|
|00004e50| 68 65 20 66 6c 6f 61 74 | 69 6e 67 20 70 6f 69 6e |he float|ing poin|
|00004e60| 74 20 50 52 4e 47 0a 20 | 20 20 20 20 20 20 20 20 |t PRNG. | |
|00004e70| 20 70 61 63 6b 61 67 65 | 20 61 6e 64 20 69 6e 73 | package| and ins|
|00004e80| 74 61 6e 63 65 73 20 6f | 66 20 74 68 65 20 28 64 |tances o|f the (d|
|00004e90| 69 73 63 72 65 74 65 29 | 20 50 52 4e 47 20 70 61 |iscrete)| PRNG pa|
|00004ea0| 63 6b 61 67 65 20 61 72 | 65 0a 20 20 20 20 20 20 |ckage ar|e. |
|00004eb0| 20 20 20 20 69 6e 64 69 | 76 69 64 75 61 6c 6c 79 | indi|vidually|
|00004ec0| 20 63 61 70 61 62 6c 65 | 20 6f 66 20 70 72 6f 64 | capable| of prod|
|00004ed0| 75 63 69 6e 67 20 69 6e | 64 65 70 65 6e 64 65 6e |ucing in|dependen|
|00004ee0| 74 20 73 74 72 65 61 6d | 73 20 6f 66 20 72 61 6e |t stream|s of ran|
|00004ef0| 64 6f 6d 0a 20 20 20 20 | 20 20 20 20 20 20 6e 75 |dom. | nu|
|00004f00| 6d 62 65 72 73 2e 20 53 | 74 72 65 61 6d 73 20 6d |mbers. S|treams m|
|00004f10| 61 79 20 62 65 20 69 6e | 74 65 72 72 75 70 74 65 |ay be in|terrupte|
|00004f20| 64 2c 20 73 74 6f 72 65 | 64 2c 20 61 6e 64 20 72 |d, store|d, and r|
|00004f30| 65 73 75 6d 65 64 20 61 | 74 0a 20 20 20 20 20 20 |esumed a|t. |
|00004f40| 20 20 20 20 6c 61 74 65 | 72 20 74 69 6d 65 73 20 | late|r times |
|00004f50| 28 67 65 6e 65 72 61 6c | 6c 79 20 61 6e 20 69 6d |(general|ly an im|
|00004f60| 70 6f 72 74 61 6e 74 20 | 72 65 71 75 69 72 65 6d |portant |requirem|
|00004f70| 65 6e 74 20 69 6e 0a 20 | 20 20 20 20 20 20 20 20 |ent in. | |
|00004f80| 20 73 69 6d 75 6c 61 74 | 69 6f 6e 73 29 2e 20 49 | simulat|ions). I|
|00004f90| 6e 20 41 64 61 20 69 74 | 20 69 73 20 63 6f 6e 73 |n Ada it| is cons|
|00004fa0| 69 64 65 72 65 64 20 69 | 6d 70 6f 72 74 61 6e 74 |idered i|mportant|
|00004fb0| 20 74 68 61 74 20 6d 75 | 6c 74 69 70 6c 65 0a 20 | that mu|ltiple. |
|00004fc0| 20 20 20 20 20 20 20 20 | 20 74 61 73 6b 73 2c 20 | | tasks, |
|00004fd0| 65 6e 67 61 67 65 64 20 | 66 6f 72 20 65 78 61 6d |engaged |for exam|
|00004fe0| 70 6c 65 20 69 6e 20 73 | 69 6d 75 6c 61 74 69 6f |ple in s|imulatio|
|00004ff0| 6e 73 2c 20 68 61 76 65 | 20 65 61 73 79 20 61 63 |ns, have| easy ac|
|00005000| 63 65 73 73 20 74 6f 0a | 20 20 20 20 20 20 20 20 |cess to.| |
|00005010| 20 20 69 6e 64 65 70 65 | 6e 64 65 6e 74 20 73 74 | indepe|ndent st|
|00005020| 72 65 61 6d 73 20 6f 66 | 20 70 73 65 75 64 6f 20 |reams of| pseudo |
|00005030| 72 61 6e 64 6f 6d 20 6e | 75 6d 62 65 72 73 2e 20 |random n|umbers. |
|00005040| 54 68 65 20 47 6e 75 20 | 41 64 61 20 39 35 0a 20 |The Gnu |Ada 95. |
|00005050| 20 20 20 20 20 20 20 20 | 20 63 6f 6d 70 69 6c 65 | | compile|
|00005060| 72 20 70 72 6f 76 69 64 | 65 73 20 74 68 65 20 63 |r provid|es the c|
|00005070| 72 79 70 74 6f 67 72 61 | 70 68 69 63 61 6c 6c 79 |ryptogra|phically|
|00005080| 20 73 65 63 75 72 65 20 | 58 2a 2a 32 20 6d 6f 64 | secure |X**2 mod|
|00005090| 20 4e 0a 20 20 20 20 20 | 20 20 20 20 20 67 65 6e | N. | gen|
|000050a0| 65 72 61 74 6f 72 20 6f | 66 20 42 6c 75 6d 2c 20 |erator o|f Blum, |
|000050b0| 42 6c 75 6d 20 61 6e 64 | 20 53 68 75 62 2e 0a 0a |Blum and| Shub...|
|000050c0| 20 20 20 20 20 20 20 20 | 20 20 28 53 65 65 20 73 | | (See s|
|000050d0| 75 62 63 6c 61 75 73 65 | 20 41 2e 35 2e 32 20 6f |ubclause| A.5.2 o|
|000050e0| 66 20 74 68 65 20 41 64 | 61 20 39 35 20 52 65 66 |f the Ad|a 95 Ref|
|000050f0| 65 72 65 6e 63 65 20 4d | 61 6e 75 61 6c 2c 20 61 |erence M|anual, a|
|00005100| 6e 64 20 70 61 72 74 0a | 20 20 20 20 20 20 20 20 |nd part.| |
|00005110| 20 20 49 49 49 2c 20 73 | 65 63 74 69 6f 6e 20 41 | III, s|ection A|
|00005120| 2e 33 2e 32 20 6f 66 20 | 74 68 65 20 41 64 61 20 |.3.2 of |the Ada |
|00005130| 52 61 74 69 6f 6e 61 6c | 65 2e 29 0a 0a 20 20 20 |Rational|e.).. |
|00005140| 31 34 2e 20 57 65 6c 6c | 2d 64 65 66 69 6e 65 64 |14. Well|-defined|
|00005150| 20 69 6e 74 65 72 66 61 | 63 65 73 20 74 6f 20 46 | interfa|ces to F|
|00005160| 6f 72 74 72 61 6e 20 61 | 6e 64 20 6f 74 68 65 72 |ortran a|nd other|
|00005170| 20 6c 61 6e 67 75 61 67 | 65 73 2e 20 28 41 64 61 | languag|es. (Ada|
|00005180| 20 38 33 0a 20 20 20 20 | 20 20 20 20 20 20 61 6e | 83. | an|
|00005190| 64 20 41 64 61 20 39 35 | 29 0a 20 20 20 20 20 20 |d Ada 95|). |
|000051a0| 20 20 20 20 49 74 20 68 | 61 73 20 61 6c 77 61 79 | It h|as alway|
|000051b0| 73 20 62 65 65 6e 20 61 | 20 62 61 73 69 63 20 72 |s been a| basic r|
|000051c0| 65 71 75 69 72 65 6d 65 | 6e 74 20 6f 66 20 74 68 |equireme|nt of th|
|000051d0| 65 20 6c 61 6e 67 75 61 | 67 65 20 74 68 61 74 20 |e langua|ge that |
|000051e0| 69 74 0a 20 20 20 20 20 | 20 20 20 20 20 70 72 6f |it. | pro|
|000051f0| 76 69 64 65 20 75 73 65 | 72 73 20 61 20 77 61 79 |vide use|rs a way|
|00005200| 20 74 6f 20 69 6e 74 65 | 72 66 61 63 65 20 41 64 | to inte|rface Ad|
|00005210| 61 20 70 72 6f 67 72 61 | 6d 73 20 77 69 74 68 20 |a progra|ms with |
|00005220| 66 6f 72 65 69 67 6e 0a | 20 20 20 20 20 20 20 20 |foreign.| |
|00005230| 20 20 6c 61 6e 67 75 61 | 67 65 73 2c 20 6f 70 65 | langua|ges, ope|
|00005240| 72 61 74 69 6e 67 20 73 | 79 73 74 65 6d 20 73 65 |rating s|ystem se|
|00005250| 72 76 69 63 65 73 2c 20 | 47 55 49 27 73 2c 20 65 |rvices, |GUI's, e|
|00005260| 74 63 2e 20 41 64 61 20 | 63 61 6e 20 62 65 0a 20 |tc. Ada |can be. |
|00005270| 20 20 20 20 20 20 20 20 | 20 76 69 65 77 65 64 20 | | viewed |
|00005280| 61 73 20 61 6e 20 69 6e | 74 65 72 66 61 63 69 6e |as an in|terfacin|
|00005290| 67 20 6c 61 6e 67 75 61 | 67 65 3a 20 69 74 73 20 |g langua|ge: its |
|000052a0| 6d 6f 64 75 6c 65 20 73 | 79 73 74 65 6d 20 69 73 |module s|ystem is|
|000052b0| 0a 20 20 20 20 20 20 20 | 20 20 20 63 6f 6d 70 6f |. | compo|
|000052c0| 73 65 64 20 6f 66 20 70 | 61 63 6b 61 67 65 20 73 |sed of p|ackage s|
|000052d0| 70 65 63 69 66 69 63 61 | 74 69 6f 6e 73 20 61 6e |pecifica|tions an|
|000052e0| 64 20 73 65 70 61 72 61 | 74 65 20 70 61 63 6b 61 |d separa|te packa|
|000052f0| 67 65 20 62 6f 64 69 65 | 73 2e 0a 20 20 20 20 20 |ge bodie|s.. |
|00005300| 20 20 20 20 20 54 68 65 | 20 70 61 63 6b 61 67 65 | The| package|
|00005310| 20 73 70 65 63 69 66 69 | 63 61 74 69 6f 6e 73 20 | specifi|cations |
|00005320| 63 61 6e 20 62 65 20 75 | 73 65 64 20 61 73 20 73 |can be u|sed as s|
|00005330| 74 72 6f 6e 67 6c 79 2d | 74 79 70 65 0a 20 20 20 |trongly-|type. |
|00005340| 20 20 20 20 20 20 20 69 | 6e 74 65 72 66 61 63 65 | i|nterface|
|00005350| 73 20 74 6f 20 6c 69 62 | 72 61 72 69 65 73 20 69 |s to lib|raries i|
|00005360| 6d 70 6c 65 6d 65 6e 74 | 65 64 20 69 6e 20 66 6f |mplement|ed in fo|
|00005370| 72 65 69 67 6e 20 6c 61 | 6e 67 75 61 67 65 73 2c |reign la|nguages,|
|00005380| 20 61 73 0a 20 20 20 20 | 20 20 20 20 20 20 77 65 | as. | we|
|00005390| 6c 6c 20 61 73 20 74 6f | 20 70 61 63 6b 61 67 65 |ll as to| package|
|000053a0| 20 62 6f 64 69 65 73 20 | 77 72 69 74 74 65 6e 20 | bodies |written |
|000053b0| 69 6e 20 41 64 61 2e 20 | 41 64 61 20 39 35 20 65 |in Ada. |Ada 95 e|
|000053c0| 78 74 65 6e 64 73 20 6f | 6e 0a 20 20 20 20 20 20 |xtends o|n. |
|000053d0| 20 20 20 20 74 68 65 73 | 65 20 66 61 63 69 6c 69 | thes|e facili|
|000053e0| 74 69 65 73 20 77 69 74 | 68 20 70 61 63 6b 61 67 |ties wit|h packag|
|000053f0| 65 20 69 6e 74 65 72 66 | 61 63 65 73 20 74 6f 20 |e interf|aces to |
|00005400| 74 68 65 20 62 61 73 69 | 63 20 64 61 74 61 0a 20 |the basi|c data. |
|00005410| 20 20 20 20 20 20 20 20 | 20 73 74 72 75 63 74 75 | | structu|
|00005420| 72 65 73 20 6f 66 20 43 | 2c 20 46 6f 72 74 72 61 |res of C|, Fortra|
|00005430| 6e 2c 20 61 6e 64 20 43 | 4f 42 4f 4c 20 61 6e 64 |n, and C|OBOL and|
|00005440| 20 77 69 74 68 20 6e 65 | 77 20 70 72 61 67 6d 61 | with ne|w pragma|
|00005450| 73 2e 20 46 6f 72 0a 20 | 20 20 20 20 20 20 20 20 |s. For. | |
|00005460| 20 65 78 61 6d 70 6c 65 | 2c 20 22 70 72 61 67 6d | example|, "pragm|
|00005470| 61 20 43 6f 6e 76 65 6e | 74 69 6f 6e 28 46 6f 72 |a Conven|tion(For|
|00005480| 74 72 61 6e 2c 20 4d 29 | 22 20 74 65 6c 6c 73 20 |tran, M)|" tells |
|00005490| 74 68 65 20 63 6f 6d 70 | 69 6c 65 72 20 74 6f 0a |the comp|iler to.|
|000054a0| 20 20 20 20 20 20 20 20 | 20 20 73 74 6f 72 65 20 | | store |
|000054b0| 74 68 65 20 65 6c 65 6d | 65 6e 74 73 20 6f 66 20 |the elem|ents of |
|000054c0| 6d 61 74 72 69 63 65 73 | 20 6f 66 20 74 79 70 65 |matrices| of type|
|000054d0| 20 4d 20 69 6e 20 74 68 | 65 20 46 6f 72 74 72 61 | M in th|e Fortra|
|000054e0| 6e 0a 20 20 20 20 20 20 | 20 20 20 20 63 6f 6c 75 |n. | colu|
|000054f0| 6d 6e 2d 6d 61 6a 6f 72 | 20 6f 72 64 65 72 2e 20 |mn-major| order. |
|00005500| 28 54 68 69 73 20 70 72 | 61 67 6d 61 20 68 61 73 |(This pr|agma has|
|00005510| 20 61 6c 72 65 61 64 79 | 20 62 65 65 6e 20 69 6d | already| been im|
|00005520| 70 6c 65 6d 65 6e 74 65 | 64 0a 20 20 20 20 20 20 |plemente|d. |
|00005530| 20 20 20 20 69 6e 20 74 | 68 65 20 47 6e 75 20 41 | in t|he Gnu A|
|00005540| 64 61 20 39 35 20 63 6f | 6d 70 69 6c 65 72 2e 20 |da 95 co|mpiler. |
|00005550| 4d 75 6c 74 69 2d 20 6c | 69 6e 67 75 61 6c 20 70 |Multi- l|ingual p|
|00005560| 72 6f 67 72 61 6d 6d 69 | 6e 67 20 69 73 20 61 6c |rogrammi|ng is al|
|00005570| 73 6f 0a 20 20 20 20 20 | 20 20 20 20 20 61 20 62 |so. | a b|
|00005580| 61 73 69 63 20 65 6c 65 | 6d 65 6e 74 20 6f 66 20 |asic ele|ment of |
|00005590| 74 68 65 20 47 6e 75 20 | 63 6f 6d 70 69 6c 65 72 |the Gnu |compiler|
|000055a0| 20 70 72 6f 6a 65 63 74 | 2e 29 20 41 73 20 61 20 | project|.) As a |
|000055b0| 72 65 73 75 6c 74 2c 0a | 20 20 20 20 20 20 20 20 |result,.| |
|000055c0| 20 20 61 73 73 65 6d 62 | 6c 79 20 6c 61 6e 67 75 | assemb|ly langu|
|000055d0| 61 67 65 20 42 4c 41 53 | 20 61 6e 64 20 6f 74 68 |age BLAS| and oth|
|000055e0| 65 72 20 68 69 67 68 20 | 70 65 72 66 6f 72 6d 61 |er high |performa|
|000055f0| 6e 63 65 20 6c 69 6e 65 | 61 72 0a 20 20 20 20 20 |nce line|ar. |
|00005600| 20 20 20 20 20 61 6c 67 | 65 62 72 61 20 61 6e 64 | alg|ebra and|
|00005610| 20 63 6f 6d 6d 75 6e 69 | 63 61 74 69 6f 6e 73 20 | communi|cations |
|00005620| 6c 69 62 72 61 72 69 65 | 73 20 77 69 6c 6c 20 62 |librarie|s will b|
|00005630| 65 20 61 63 63 65 73 73 | 69 62 6c 65 20 74 6f 20 |e access|ible to |
|00005640| 41 64 61 0a 20 20 20 20 | 20 20 20 20 20 20 70 72 |Ada. | pr|
|00005650| 6f 67 72 61 6d 73 2e 0a | 0a 20 20 20 20 20 20 20 |ograms..|. |
|00005660| 20 20 20 28 53 65 65 20 | 41 64 61 20 39 35 20 52 | (See |Ada 95 R|
|00005670| 65 66 65 72 65 6e 63 65 | 20 4d 61 6e 75 61 6c 3a |eference| Manual:|
|00005680| 20 63 6c 61 75 73 65 20 | 42 2e 31 20 61 6e 64 20 | clause |B.1 and |
|00005690| 42 2e 35 20 6f 66 20 41 | 6e 6e 65 78 20 42 2c 0a |B.5 of A|nnex B,.|
|000056a0| 20 20 20 20 20 20 20 20 | 20 20 61 6e 64 20 41 64 | | and Ad|
|000056b0| 61 20 39 35 20 52 61 74 | 69 6f 6e 61 6c 65 3a 20 |a 95 Rat|ionale: |
|000056c0| 50 61 72 74 20 49 49 49 | 20 42 2e 29 0a 0a 0a 36 |Part III| B.)...6|
|000056d0| 2e 34 3a 20 48 6f 77 20 | 64 6f 20 49 20 67 65 74 |.4: How |do I get|
|000056e0| 20 52 65 61 6c 20 76 61 | 6c 75 65 64 20 61 6e 64 | Real va|lued and|
|000056f0| 20 43 6f 6d 70 6c 65 78 | 20 76 61 6c 75 65 64 20 | Complex| valued |
|00005700| 6d 61 74 68 20 66 75 6e | 63 74 69 6f 6e 73 20 69 |math fun|ctions i|
|00005710| 6e 20 41 64 61 20 39 35 | 3f 0a 0a 20 20 20 28 66 |n Ada 95|?.. (f|
|00005720| 72 6f 6d 20 4a 6f 6e 61 | 74 68 61 6e 20 50 61 72 |rom Jona|than Par|
|00005730| 6b 65 72 29 0a 0a 20 20 | 20 43 6f 6d 70 6c 65 78 |ker).. | Complex|
|00005740| 20 74 79 70 65 20 61 6e | 64 20 66 75 6e 63 74 69 | type an|d functi|
|00005750| 6f 6e 73 20 61 72 65 20 | 70 72 6f 76 69 64 65 64 |ons are |provided|
|00005760| 20 62 79 20 63 6f 6d 70 | 69 6c 65 72 73 20 74 68 | by comp|ilers th|
|00005770| 61 74 20 73 75 70 70 6f | 72 74 20 74 68 65 0a 20 |at suppo|rt the. |
|00005780| 20 20 6e 75 6d 65 72 69 | 63 73 20 41 6e 6e 65 78 | numeri|cs Annex|
|00005790| 2e 20 54 68 65 20 70 61 | 63 6b 61 67 65 73 20 74 |. The pa|ckages t|
|000057a0| 68 61 74 20 75 73 65 20 | 46 6c 6f 61 74 20 66 6f |hat use |Float fo|
|000057b0| 72 20 74 68 65 20 52 65 | 61 6c 20 6e 75 6d 62 65 |r the Re|al numbe|
|000057c0| 72 20 61 6e 64 0a 20 20 | 20 66 6f 72 20 74 68 65 |r and. | for the|
|000057d0| 20 43 6f 6d 70 6c 65 78 | 20 6e 75 6d 62 65 72 20 | Complex| number |
|000057e0| 61 72 65 3a 0a 0a 20 20 | 20 20 20 41 64 61 2e 4e |are:.. | Ada.N|
|000057f0| 75 6d 65 72 69 63 73 2e | 45 6c 65 6d 65 6e 74 61 |umerics.|Elementa|
|00005800| 72 79 5f 46 75 6e 63 74 | 69 6f 6e 73 3b 0a 20 20 |ry_Funct|ions;. |
|00005810| 20 20 20 41 64 61 2e 4e | 75 6d 65 72 69 63 73 2e | Ada.N|umerics.|
|00005820| 43 6f 6d 70 6c 65 78 5f | 54 79 70 65 73 3b 0a 20 |Complex_|Types;. |
|00005830| 20 20 20 20 41 64 61 2e | 4e 75 6d 65 72 69 63 73 | Ada.|Numerics|
|00005840| 2e 43 6f 6d 70 6c 65 78 | 5f 45 6c 65 6d 65 6e 74 |.Complex|_Element|
|00005850| 61 72 79 5f 46 75 6e 63 | 74 69 6f 6e 73 3b 0a 0a |ary_Func|tions;..|
|00005860| 0a 20 20 20 54 68 65 20 | 70 61 63 6b 61 67 65 73 |. The |packages|
|00005870| 20 74 68 61 74 20 75 73 | 65 20 4c 6f 6e 67 5f 46 | that us|e Long_F|
|00005880| 6c 6f 61 74 20 66 6f 72 | 20 74 68 65 20 52 65 61 |loat for| the Rea|
|00005890| 6c 20 6e 75 6d 62 65 72 | 20 61 6e 64 20 66 6f 72 |l number| and for|
|000058a0| 20 74 68 65 0a 20 20 20 | 43 6f 6d 70 6c 65 78 20 | the. |Complex |
|000058b0| 6e 75 6d 62 65 72 20 61 | 72 65 3a 0a 0a 20 20 20 |number a|re:.. |
|000058c0| 20 20 41 64 61 2e 4e 75 | 6d 65 72 69 63 73 2e 4c | Ada.Nu|merics.L|
|000058d0| 6f 6e 67 5f 45 6c 65 6d | 65 6e 74 61 72 79 5f 46 |ong_Elem|entary_F|
|000058e0| 75 6e 63 74 69 6f 6e 73 | 3b 0a 20 20 20 20 20 41 |unctions|;. A|
|000058f0| 64 61 2e 4e 75 6d 65 72 | 69 63 73 2e 4c 6f 6e 67 |da.Numer|ics.Long|
|00005900| 5f 43 6f 6d 70 6c 65 78 | 5f 54 79 70 65 73 3b 0a |_Complex|_Types;.|
|00005910| 20 20 20 20 20 41 64 61 | 2e 4e 75 6d 65 72 69 63 | Ada|.Numeric|
|00005920| 73 2e 4c 6f 6e 67 5f 43 | 6f 6d 70 6c 65 78 5f 45 |s.Long_C|omplex_E|
|00005930| 6c 65 6d 65 6e 74 61 72 | 79 5f 46 75 6e 63 74 69 |lementar|y_Functi|
|00005940| 6f 6e 73 3b 0a 0a 0a 20 | 20 20 54 68 65 20 67 65 |ons;... | The ge|
|00005950| 6e 65 72 69 63 20 76 65 | 72 73 69 6f 6e 73 20 61 |neric ve|rsions a|
|00005960| 72 65 20 64 65 6d 6f 6e | 73 74 72 61 74 65 64 20 |re demon|strated |
|00005970| 69 6e 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |in the f|ollowing|
|00005980| 20 65 78 61 6d 70 6c 65 | 2e 20 4b 65 65 70 0a 20 | example|. Keep. |
|00005990| 20 20 69 6e 20 6d 69 6e | 64 20 74 68 61 74 20 74 | in min|d that t|
|000059a0| 68 65 20 6e 6f 6e 2d 67 | 65 6e 65 72 69 63 20 70 |he non-g|eneric p|
|000059b0| 61 63 6b 61 67 65 73 20 | 6d 61 79 20 68 61 76 65 |ackages |may have|
|000059c0| 20 62 65 65 6e 20 62 65 | 74 74 65 72 20 74 75 6e | been be|tter tun|
|000059d0| 65 64 20 66 6f 72 0a 20 | 20 20 73 70 65 65 64 20 |ed for. | speed |
|000059e0| 6f 72 20 61 63 63 75 72 | 61 63 79 2e 20 49 6e 20 |or accur|acy. In |
|000059f0| 70 72 61 63 74 69 63 65 | 20 79 6f 75 20 77 6f 6e |practice| you won|
|00005a00| 27 74 20 61 6c 77 61 79 | 73 20 69 6e 73 74 61 6e |'t alway|s instan|
|00005a10| 74 69 61 74 65 20 61 6c | 6c 20 74 68 72 65 65 0a |tiate al|l three.|
|00005a20| 20 20 20 70 61 63 6b 61 | 67 65 73 20 61 74 20 74 | packa|ges at t|
|00005a30| 68 65 20 73 61 6d 65 20 | 74 69 6d 65 2c 20 62 75 |he same |time, bu|
|00005a40| 74 20 68 65 72 65 20 69 | 73 20 68 6f 77 20 79 6f |t here i|s how yo|
|00005a50| 75 20 64 6f 20 69 74 3a | 0a 0a 20 20 20 20 20 77 |u do it:|.. w|
|00005a60| 69 74 68 20 41 64 61 2e | 4e 75 6d 65 72 69 63 73 |ith Ada.|Numerics|
|00005a70| 2e 47 65 6e 65 72 69 63 | 5f 43 6f 6d 70 6c 65 78 |.Generic|_Complex|
|00005a80| 5f 54 79 70 65 73 3b 0a | 20 20 20 20 20 77 69 74 |_Types;.| wit|
|00005a90| 68 20 41 64 61 2e 4e 75 | 6d 65 72 69 63 73 2e 47 |h Ada.Nu|merics.G|
|00005aa0| 65 6e 65 72 69 63 5f 45 | 6c 65 6d 65 6e 74 61 72 |eneric_E|lementar|
|00005ab0| 79 5f 46 75 6e 63 74 69 | 6f 6e 73 3b 0a 20 20 20 |y_Functi|ons;. |
|00005ac0| 20 20 77 69 74 68 20 41 | 64 61 2e 4e 75 6d 65 72 | with A|da.Numer|
|00005ad0| 69 63 73 2e 47 65 6e 65 | 72 69 63 5f 43 6f 6d 70 |ics.Gene|ric_Comp|
|00005ae0| 6c 65 78 5f 45 6c 65 6d | 65 6e 74 61 72 79 5f 46 |lex_Elem|entary_F|
|00005af0| 75 6e 63 74 69 6f 6e 73 | 3b 0a 0a 20 20 20 20 20 |unctions|;.. |
|00005b00| 70 72 6f 63 65 64 75 72 | 65 20 44 6f 5f 53 6f 6d |procedur|e Do_Som|
|00005b10| 65 74 68 69 6e 67 5f 4e | 75 6d 65 72 69 63 61 6c |ething_N|umerical|
|00005b20| 20 69 73 0a 0a 20 20 20 | 20 20 20 20 74 79 70 65 | is.. | type|
|00005b30| 20 52 65 61 6c 5f 38 20 | 69 73 20 64 69 67 69 74 | Real_8 |is digit|
|00005b40| 73 20 31 35 3b 0a 0a 20 | 20 20 20 20 20 20 70 61 |s 15;.. | pa|
|00005b50| 63 6b 61 67 65 20 52 65 | 61 6c 5f 46 75 6e 63 74 |ckage Re|al_Funct|
|00005b60| 69 6f 6e 73 5f 38 20 69 | 73 0a 20 20 20 20 20 20 |ions_8 i|s. |
|00005b70| 20 20 20 6e 65 77 20 41 | 64 61 2e 4e 75 6d 65 72 | new A|da.Numer|
|00005b80| 69 63 73 2e 47 65 6e 65 | 72 69 63 5f 45 6c 65 6d |ics.Gene|ric_Elem|
|00005b90| 65 6e 74 61 72 79 5f 46 | 75 6e 63 74 69 6f 6e 73 |entary_F|unctions|
|00005ba0| 20 28 52 65 61 6c 5f 38 | 29 3b 0a 0a 20 20 20 20 | (Real_8|);.. |
|00005bb0| 20 20 20 70 61 63 6b 61 | 67 65 20 43 6f 6d 70 6c | packa|ge Compl|
|00005bc0| 65 78 5f 4e 75 6d 73 5f | 38 20 69 73 0a 20 20 20 |ex_Nums_|8 is. |
|00005bd0| 20 20 20 20 20 20 6e 65 | 77 20 41 64 61 2e 4e 75 | ne|w Ada.Nu|
|00005be0| 6d 65 72 69 63 73 2e 47 | 65 6e 65 72 69 63 5f 43 |merics.G|eneric_C|
|00005bf0| 6f 6d 70 6c 65 78 5f 54 | 79 70 65 73 20 28 52 65 |omplex_T|ypes (Re|
|00005c00| 61 6c 5f 38 29 3b 0a 0a | 20 20 20 20 20 20 20 70 |al_8);..| p|
|00005c10| 61 63 6b 61 67 65 20 43 | 6f 6d 70 6c 65 78 5f 46 |ackage C|omplex_F|
|00005c20| 75 6e 63 74 69 6f 6e 73 | 5f 38 20 69 73 0a 20 20 |unctions|_8 is. |
|00005c30| 20 20 20 20 20 20 20 6e | 65 77 20 41 64 61 2e 4e | n|ew Ada.N|
|00005c40| 75 6d 65 72 69 63 73 2e | 47 65 6e 65 72 69 63 5f |umerics.|Generic_|
|00005c50| 43 6f 6d 70 6c 65 78 5f | 45 6c 65 6d 65 6e 74 61 |Complex_|Elementa|
|00005c60| 72 79 5f 46 75 6e 63 74 | 69 6f 6e 73 0a 20 20 20 |ry_Funct|ions. |
|00005c70| 20 20 20 20 20 20 20 20 | 28 43 6f 6d 70 6c 65 78 | |(Complex|
|00005c80| 5f 4e 75 6d 73 5f 38 29 | 3b 0a 0a 20 20 20 20 20 |_Nums_8)|;.. |
|00005c90| 20 20 75 73 65 20 52 65 | 61 6c 5f 46 75 6e 63 74 | use Re|al_Funct|
|00005ca0| 69 6f 6e 73 5f 38 2c 20 | 43 6f 6d 70 6c 65 78 5f |ions_8, |Complex_|
|00005cb0| 4e 75 6d 73 5f 38 2c 20 | 43 6f 6d 70 6c 65 78 5f |Nums_8, |Complex_|
|00005cc0| 46 75 6e 63 74 69 6f 6e | 73 5f 38 3b 0a 20 20 20 |Function|s_8;. |
|00005cd0| 20 20 20 20 2e 2e 2e 0a | 20 20 20 20 20 20 20 2e | ....| .|
|00005ce0| 2e 2e 20 2d 2d 20 44 6f | 20 73 6f 6d 65 74 68 69 |.. -- Do| somethi|
|00005cf0| 6e 67 0a 20 20 20 20 20 | 20 20 2e 2e 2e 0a 20 20 |ng. | .... |
|00005d00| 20 20 20 65 6e 64 20 44 | 6f 5f 53 6f 6d 65 74 68 | end D|o_Someth|
|00005d10| 69 6e 67 5f 4e 75 6d 65 | 72 69 63 61 6c 3b 0a 0a |ing_Nume|rical;..|
|00005d20| 0a 36 2e 35 3a 20 57 68 | 61 74 20 6c 69 62 72 61 |.6.5: Wh|at libra|
|00005d30| 72 69 65 73 20 6f 72 20 | 70 75 62 6c 69 63 20 61 |ries or |public a|
|00005d40| 6c 67 6f 72 69 74 68 6d | 73 20 65 78 69 73 74 20 |lgorithm|s exist |
|00005d50| 66 6f 72 20 41 64 61 3f | 0a 0a 20 20 20 41 6e 20 |for Ada?|.. An |
|00005d60| 41 64 61 20 76 65 72 73 | 69 6f 6e 20 6f 66 20 46 |Ada vers|ion of F|
|00005d70| 61 73 74 20 46 6f 75 72 | 69 65 72 20 54 72 61 6e |ast Four|ier Tran|
|00005d80| 73 66 6f 72 6d 20 69 73 | 20 61 76 61 69 6c 61 62 |sform is| availab|
|00005d90| 6c 65 2e 20 49 74 27 73 | 20 69 6e 0a 20 20 20 6a |le. It's| in. j|
|00005da0| 6f 75 72 6e 61 6c 20 22 | 43 6f 6d 70 75 74 65 72 |ournal "|Computer|
|00005db0| 73 20 26 20 4d 61 74 68 | 65 6d 61 74 69 63 73 20 |s & Math|ematics |
|00005dc0| 77 69 74 68 20 41 70 70 | 6c 69 63 61 74 69 6f 6e |with App|lication|
|00005dd0| 73 2c 22 20 76 6f 6c 2e | 20 32 36 2c 20 6e 6f 2e |s," vol.| 26, no.|
|00005de0| 20 32 2c 0a 20 20 20 70 | 70 2e 20 36 31 2d 36 35 | 2,. p|p. 61-65|
|00005df0| 2c 20 31 39 39 33 2c 20 | 77 69 74 68 20 74 68 65 |, 1993, |with the|
|00005e00| 20 74 69 74 6c 65 3a 0a | 0a 20 20 20 22 41 6e 61 | title:.|. "Ana|
|00005e10| 6c 79 73 69 73 20 6f 66 | 20 61 6e 20 41 64 61 20 |lysis of| an Ada |
|00005e20| 42 61 73 65 64 20 56 65 | 72 73 69 6f 6e 20 6f 66 |Based Ve|rsion of|
|00005e30| 20 47 6c 61 73 73 6d 61 | 6e 27 73 20 47 65 6e 65 | Glassma|n's Gene|
|00005e40| 72 61 6c 20 4e 20 50 6f | 69 6e 74 20 46 61 73 74 |ral N Po|int Fast|
|00005e50| 0a 20 20 20 46 6f 75 72 | 69 65 72 20 54 72 61 6e |. Four|ier Tran|
|00005e60| 73 66 6f 72 6d 22 0a 0a | 20 20 20 54 68 65 20 70 |sform"..| The p|
|00005e70| 61 63 6b 61 67 65 20 69 | 73 20 6e 6f 77 20 61 76 |ackage i|s now av|
|00005e80| 61 69 6c 61 62 6c 65 20 | 69 6e 20 74 68 65 20 41 |ailable |in the A|
|00005e90| 64 61 4e 45 54 20 72 65 | 70 6f 73 69 74 6f 72 79 |daNET re|pository|
|00005ea0| 2c 20 6f 62 6a 65 63 74 | 20 23 3a 20 36 37 32 38 |, object| #: 6728|
|00005eb0| 2c 0a 20 20 20 69 6e 20 | 63 6f 6c 6c 65 63 74 69 |,. in |collecti|
|00005ec0| 6f 6e 3a 20 54 72 61 6e | 73 66 6f 72 6d 73 2e 20 |on: Tran|sforms. |
|00005ed0| 49 66 20 79 6f 75 27 72 | 65 20 6e 6f 74 20 61 6e |If you'r|e not an|
|00005ee0| 20 41 64 61 4e 45 54 20 | 75 73 65 72 2c 20 63 6f | AdaNET |user, co|
|00005ef0| 6e 74 61 63 74 20 50 65 | 67 67 79 0a 20 20 20 4c |ntact Pe|ggy. L|
|00005f00| 61 63 65 79 20 28 6c 61 | 63 65 79 40 72 62 73 65 |acey (la|cey@rbse|
|00005f10| 2e 6d 6f 75 6e 74 61 69 | 6e 2e 6e 65 74 29 2e 0a |.mountai|n.net)..|
|00005f20| 0a 20 20 20 20 20 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |. __|________|
|00005f30| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005f40| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005f50| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00005f60| 5f 5f 5f 5f 5f 5f 5f 0a | 0a 0a 37 3a 20 45 66 66 |_______.|..7: Eff|
|00005f70| 69 63 69 65 6e 63 79 20 | 6f 66 20 41 64 61 20 43 |iciency |of Ada C|
|00005f80| 6f 6e 73 74 72 75 63 74 | 73 0a 0a 0a 37 2e 31 3a |onstruct|s...7.1:|
|00005f90| 20 48 6f 77 20 6d 75 63 | 68 20 65 78 74 72 61 20 | How muc|h extra |
|00005fa0| 6f 76 65 72 68 65 61 64 | 20 64 6f 20 67 65 6e 65 |overhead| do gene|
|00005fb0| 72 69 63 73 20 68 61 76 | 65 3f 0a 0a 20 20 20 49 |rics hav|e?.. I|
|00005fc0| 66 20 79 6f 75 20 6f 76 | 65 72 67 65 6e 65 72 61 |f you ov|ergenera|
|00005fd0| 6c 69 7a 65 20 74 68 65 | 20 67 65 6e 65 72 69 63 |lize the| generic|
|00005fe0| 2c 20 74 68 65 72 65 20 | 77 69 6c 6c 20 62 65 20 |, there |will be |
|00005ff0| 6d 6f 72 65 20 77 6f 72 | 6b 20 74 6f 20 64 6f 20 |more wor|k to do |
|00006000| 66 6f 72 0a 20 20 20 74 | 68 65 20 63 6f 6d 70 69 |for. t|he compi|
|00006010| 6c 65 72 2e 20 48 6f 77 | 20 64 6f 20 79 6f 75 20 |ler. How| do you |
|00006020| 6b 6e 6f 77 20 77 68 65 | 6e 20 79 6f 75 20 68 61 |know whe|n you ha|
|00006030| 76 65 20 6f 76 65 72 67 | 65 6e 65 72 61 6c 69 7a |ve overg|eneraliz|
|00006040| 65 64 3f 20 46 6f 72 0a | 20 20 20 69 6e 73 74 61 |ed? For.| insta|
|00006050| 6e 63 65 2c 20 70 61 73 | 73 69 6e 67 20 61 72 69 |nce, pas|sing ari|
|00006060| 74 68 6d 65 74 69 63 20 | 6f 70 65 72 61 74 69 6f |thmetic |operatio|
|00006070| 6e 73 20 61 73 20 70 61 | 72 61 6d 65 74 65 72 73 |ns as pa|rameters|
|00006080| 20 69 73 20 61 20 62 61 | 64 20 73 69 67 6e 2e 0a | is a ba|d sign..|
|00006090| 20 20 20 53 6f 20 61 72 | 65 20 62 6f 6f 6c 65 61 | So ar|e boolea|
|000060a0| 6e 20 6f 72 20 65 6e 75 | 6d 65 72 61 74 69 6f 6e |n or enu|meration|
|000060b0| 20 74 79 70 65 20 67 65 | 6e 65 72 69 63 20 66 6f | type ge|neric fo|
|000060c0| 72 6d 61 6c 20 70 61 72 | 61 6d 65 74 65 72 73 2e |rmal par|ameters.|
|000060d0| 20 49 66 20 79 6f 75 0a | 20 20 20 6e 65 76 65 72 | If you.| never|
|000060e0| 20 6f 76 65 72 72 69 64 | 65 20 74 68 65 20 64 65 | overrid|e the de|
|000060f0| 66 61 75 6c 74 73 20 66 | 6f 72 20 61 20 70 61 72 |faults f|or a par|
|00006100| 61 6d 65 74 65 72 2c 20 | 79 6f 75 20 70 72 6f 62 |ameter, |you prob|
|00006110| 61 62 6c 79 0a 20 20 20 | 6f 76 65 72 65 6e 67 69 |ably. |overengi|
|00006120| 6e 65 65 72 65 64 2e 0a | 0a 20 20 20 43 6f 64 65 |neered..|. Code|
|00006130| 20 73 68 61 72 69 6e 67 | 20 28 69 66 20 69 6d 70 | sharing| (if imp|
|00006140| 6c 65 6d 65 6e 74 65 64 | 20 61 6e 64 20 72 65 71 |lemented| and req|
|00006150| 75 65 73 74 65 64 29 20 | 77 69 6c 6c 20 63 61 75 |uested) |will cau|
|00006160| 73 65 20 61 6e 20 61 64 | 64 69 74 69 6f 6e 61 6c |se an ad|ditional|
|00006170| 0a 20 20 20 6f 76 65 72 | 68 65 61 64 20 6f 6e 20 |. over|head on |
|00006180| 73 6f 6d 65 20 63 61 6c | 6c 73 2c 20 77 68 69 63 |some cal|ls, whic|
|00006190| 68 20 77 69 6c 6c 20 62 | 65 20 70 61 72 74 69 61 |h will b|e partia|
|000061a0| 6c 6c 79 20 6f 66 66 73 | 65 74 20 62 79 20 69 6d |lly offs|et by im|
|000061b0| 70 72 6f 76 65 64 0a 20 | 20 20 6c 6f 63 61 6c 69 |proved. | locali|
|000061c0| 74 79 20 6f 66 20 72 65 | 66 65 72 65 6e 63 65 2e |ty of re|ference.|
|000061d0| 20 28 54 72 61 6e 73 6c | 61 74 69 6f 6e 2c 20 63 | (Transl|ation, c|
|000061e0| 6f 64 65 20 73 68 61 72 | 69 6e 67 20 6d 61 79 20 |ode shar|ing may |
|000061f0| 77 69 6e 20 6d 6f 73 74 | 20 77 68 65 6e 0a 20 20 |win most| when. |
|00006200| 20 63 61 63 68 65 20 6d | 69 73 73 65 73 20 63 6f | cache m|isses co|
|00006210| 73 74 20 6d 6f 73 74 2e | 29 20 49 66 20 61 20 67 |st most.|) If a g|
|00006220| 65 6e 65 72 69 63 20 75 | 6e 69 74 20 69 73 20 6f |eneric u|nit is o|
|00006230| 6e 6c 79 20 75 73 65 64 | 20 6f 6e 63 65 20 69 6e |nly used| once in|
|00006240| 20 61 0a 20 20 20 70 72 | 6f 67 72 61 6d 2c 20 63 | a. pr|ogram, c|
|00006250| 6f 64 65 20 73 68 61 72 | 69 6e 67 20 61 6c 77 61 |ode shar|ing alwa|
|00006260| 79 73 20 6c 6f 73 65 73 | 2e 0a 0a 20 20 20 52 2e |ys loses|... R.|
|00006270| 52 2e 20 53 6f 66 74 77 | 61 72 65 20 63 68 6f 73 |R. Softw|are chos|
|00006280| 65 20 63 6f 64 65 20 73 | 68 61 72 69 6e 67 20 61 |e code s|haring a|
|00006290| 73 20 74 68 65 20 69 6d | 70 6c 65 6d 65 6e 74 61 |s the im|plementa|
|000062a0| 74 69 6f 6e 20 66 6f 72 | 20 67 65 6e 65 72 69 63 |tion for| generic|
|000062b0| 73 0a 20 20 20 62 65 63 | 61 75 73 65 20 32 20 6f |s. bec|ause 2 o|
|000062c0| 72 20 6d 6f 72 65 20 69 | 6e 73 74 61 6e 74 69 61 |r more i|nstantia|
|000062d0| 74 69 6f 6e 73 20 6f 66 | 20 46 6c 6f 61 74 5f 49 |tions of| Float_I|
|000062e0| 6f 20 69 6e 20 61 20 6d | 61 63 72 6f 20 69 6d 70 |o in a m|acro imp|
|000062f0| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 0a 20 20 20 77 |lementat|ion. w|
|00006300| 6f 75 6c 64 20 68 61 76 | 65 20 6d 61 64 65 20 61 |ould hav|e made a|
|00006310| 20 70 72 6f 67 72 61 6d | 20 74 6f 6f 20 6c 61 72 | program| too lar|
|00006320| 67 65 20 74 6f 20 72 75 | 6e 20 69 6e 20 74 68 65 |ge to ru|n in the|
|00006330| 20 61 6d 6f 75 6e 74 20 | 6f 66 20 6d 65 6d 6f 72 | amount |of memor|
|00006340| 79 0a 20 20 20 61 76 61 | 69 6c 61 62 6c 65 20 6f |y. ava|ilable o|
|00006350| 6e 20 74 68 65 20 50 43 | 20 6d 61 63 68 69 6e 65 |n the PC| machine|
|00006360| 73 20 74 68 61 74 20 65 | 78 69 73 74 65 64 20 69 |s that e|xisted i|
|00006370| 6e 20 31 39 38 33 20 28 | 75 73 75 61 6c 6c 79 20 |n 1983 (|usually |
|00006380| 61 20 31 32 38 6b 20 6f | 72 0a 20 20 20 32 35 36 |a 128k o|r. 256|
|00006390| 6b 20 6d 61 63 68 69 6e | 65 29 2e 0a 0a 20 20 20 |k machin|e)... |
|000063a0| 47 65 6e 65 72 69 63 73 | 20 69 6e 20 41 64 61 20 |Generics| in Ada |
|000063b0| 63 61 6e 20 61 6c 73 6f | 20 72 65 73 75 6c 74 20 |can also| result |
|000063c0| 69 6e 20 6c 6f 73 73 20 | 6f 66 20 69 6e 66 6f 72 |in loss |of infor|
|000063d0| 6d 61 74 69 6f 6e 20 77 | 68 69 63 68 20 63 6f 75 |mation w|hich cou|
|000063e0| 6c 64 0a 20 20 20 68 61 | 76 65 20 68 65 6c 70 65 |ld. ha|ve helpe|
|000063f0| 64 20 74 68 65 20 6f 70 | 74 69 6d 69 7a 65 72 2e |d the op|timizer.|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.