home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 22 / SOLO_22.iso / docs / faq / prog / part3.dos < prev    next >
Mailbox/MIME Entity  |  1996-04-29  |  38.7 KB

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).

ConfidenceProgramDetectionMatch TypeSupport
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, with CRLF line terminators 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[CRLF] 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 0d 0a 46 72 |Magnus.K|empe..Fr|
|00000100| 6f 6d 3a 20 4d 61 67 6e | 75 73 2e 4b 65 6d 70 65 |om: Magn|us.Kempe|
|00000110| 40 64 69 2e 65 70 66 6c | 2e 63 68 20 28 4d 61 67 |@di.epfl|.ch (Mag|
|00000120| 6e 75 73 20 4b 65 6d 70 | 65 29 0d 0a 4e 65 77 73 |nus Kemp|e)..News|
|00000130| 67 72 6f 75 70 73 3a 20 | 63 6f 6d 70 2e 6c 61 6e |groups: |comp.lan|
|00000140| 67 2e 61 64 61 2c 63 6f | 6d 70 2e 61 6e 73 77 65 |g.ada,co|mp.answe|
|00000150| 72 73 2c 6e 65 77 73 2e | 61 6e 73 77 65 72 73 0d |rs,news.|answers.|
|00000160| 0a 53 75 62 6a 65 63 74 | 3a 20 41 64 61 20 46 41 |.Subject|: Ada FA|
|00000170| 51 3a 20 50 72 6f 67 72 | 61 6d 6d 69 6e 67 20 77 |Q: Progr|amming w|
|00000180| 69 74 68 20 41 64 61 20 | 28 70 61 72 74 20 33 20 |ith Ada |(part 3 |
|00000190| 6f 66 20 34 29 0d 0a 46 | 6f 6c 6c 6f 77 75 70 2d |of 4)..F|ollowup-|
|000001a0| 54 6f 3a 20 70 6f 73 74 | 65 72 0d 0a 44 61 74 65 |To: post|er..Date|
|000001b0| 3a 20 31 37 20 4d 61 72 | 20 31 39 39 36 20 31 34 |: 17 Mar| 1996 14|
|000001c0| 3a 32 32 3a 34 38 20 47 | 4d 54 0d 0a 4f 72 67 61 |:22:48 G|MT..Orga|
|000001d0| 6e 69 7a 61 74 69 6f 6e | 3a 20 4e 6f 6e 65 0d 0a |nization|: None..|
|000001e0| 4c 69 6e 65 73 3a 20 38 | 32 30 0d 0a 53 65 6e 64 |Lines: 8|20..Send|
|000001f0| 65 72 3a 20 6d 61 67 6e | 75 73 40 6c 67 6c 73 75 |er: magn|us@lglsu|
|00000200| 6e 34 2e 65 70 66 6c 2e | 63 68 20 28 4d 61 67 6e |n4.epfl.|ch (Magn|
|00000210| 75 73 20 4b 65 6d 70 65 | 29 0d 0a 41 70 70 72 6f |us Kempe|)..Appro|
|00000220| 76 65 64 3a 20 6e 65 77 | 73 2d 61 6e 73 77 65 72 |ved: new|s-answer|
|00000230| 73 2d 72 65 71 75 65 73 | 74 40 4d 49 54 2e 45 44 |s-reques|t@MIT.ED|
|00000240| 55 0d 0a 44 69 73 74 72 | 69 62 75 74 69 6f 6e 3a |U..Distr|ibution:|
|00000250| 20 77 6f 72 6c 64 0d 0a | 4d 65 73 73 61 67 65 2d | world..|Message-|
|00000260| 49 44 3a 20 3c 34 69 68 | 37 37 6f 24 66 71 32 40 |ID: <4ih|77o$fq2@|
|00000270| 64 69 73 75 6e 6d 73 2e | 65 70 66 6c 2e 63 68 3e |disunms.|epfl.ch>|
|00000280| 0d 0a 52 65 70 6c 79 2d | 54 6f 3a 20 4d 61 67 6e |..Reply-|To: Magn|
|00000290| 75 73 2e 4b 65 6d 70 65 | 40 64 69 2e 65 70 66 6c |us.Kempe|@di.epfl|
|000002a0| 2e 63 68 20 28 4d 61 67 | 6e 75 73 20 4b 65 6d 70 |.ch (Mag|nus Kemp|
|000002b0| 65 29 0d 0a 4e 4e 54 50 | 2d 50 6f 73 74 69 6e 67 |e)..NNTP|-Posting|
|000002c0| 2d 48 6f 73 74 3a 20 6c | 67 6c 73 75 6e 34 2e 65 |-Host: l|glsun4.e|
|000002d0| 70 66 6c 2e 63 68 0d 0a | 4d 69 6d 65 2d 56 65 72 |pfl.ch..|Mime-Ver|
|000002e0| 73 69 6f 6e 3a 20 31 2e | 30 0d 0a 43 6f 6e 74 65 |sion: 1.|0..Conte|
|000002f0| 6e 74 2d 54 79 70 65 3a | 20 74 65 78 74 2f 70 6c |nt-Type:| text/pl|
|00000300| 61 69 6e 3b 20 63 68 61 | 72 73 65 74 3d 69 73 6f |ain; cha|rset=iso|
|00000310| 2d 38 38 35 39 2d 31 0d | 0a 43 6f 6e 74 65 6e 74 |-8859-1.|.Content|
|00000320| 2d 54 72 61 6e 73 66 65 | 72 2d 45 6e 63 6f 64 69 |-Transfe|r-Encodi|
|00000330| 6e 67 3a 20 38 62 69 74 | 0d 0a 53 75 6d 6d 61 72 |ng: 8bit|..Summar|
|00000340| 79 3a 20 41 64 61 20 50 | 72 6f 67 72 61 6d 6d 65 |y: Ada P|rogramme|
|00000350| 72 27 73 20 46 72 65 71 | 75 65 6e 74 6c 79 20 41 |r's Freq|uently A|
|00000360| 73 6b 65 64 20 51 75 65 | 73 74 69 6f 6e 73 20 28 |sked Que|stions (|
|00000370| 61 6e 64 20 61 6e 73 77 | 65 72 73 29 2c 0d 0a 20 |and answ|ers),.. |
|00000380| 20 20 20 20 20 20 20 20 | 20 20 70 61 72 74 20 33 | | part 3|
|00000390| 20 6f 66 20 34 2e 0d 0a | 20 20 20 20 20 20 20 20 | of 4...| |
|000003a0| 20 50 6c 65 61 73 65 20 | 72 65 61 64 20 62 65 66 | Please |read bef|
|000003b0| 6f 72 65 20 70 6f 73 74 | 69 6e 67 2e 0d 0a 4b 65 |ore post|ing...Ke|
|000003c0| 79 77 6f 72 64 73 3a 20 | 61 64 76 61 6e 63 65 64 |ywords: |advanced|
|000003d0| 20 6c 61 6e 67 75 61 67 | 65 2c 20 61 72 74 69 66 | languag|e, artif|
|000003e0| 69 63 69 61 6c 20 6c 61 | 6e 67 75 61 67 65 73 2c |icial la|nguages,|
|000003f0| 20 63 6f 6d 70 75 74 65 | 72 20 73 6f 66 74 77 61 | compute|r softwa|
|00000400| 72 65 2c 0d 0a 20 20 20 | 20 20 20 20 20 20 20 64 |re,.. | d|
|00000410| 61 74 61 20 70 72 6f 63 | 65 73 73 69 6e 67 2c 20 |ata proc|essing, |
|00000420| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 6c 61 6e 67 |programm|ing lang|
|00000430| 75 61 67 65 73 2c 20 41 | 64 61 0d 0a 58 72 65 66 |uages, A|da..Xref|
|00000440| 3a 20 73 65 6e 61 74 6f | 72 2d 62 65 64 66 65 6c |: senato|r-bedfel|
|00000450| 6c 6f 77 2e 6d 69 74 2e | 65 64 75 20 63 6f 6d 70 |low.mit.|edu comp|
|00000460| 2e 6c 61 6e 67 2e 61 64 | 61 3a 34 32 34 36 34 20 |.lang.ad|a:42464 |
|00000470| 63 6f 6d 70 2e 61 6e 73 | 77 65 72 73 3a 31 37 36 |comp.ans|wers:176|
|00000480| 30 38 20 6e 65 77 73 2e | 61 6e 73 77 65 72 73 3a |08 news.|answers:|
|00000490| 36 37 31 36 38 0d 0a 0d | 0a 41 72 63 68 69 76 65 |67168...|.Archive|
|000004a0| 2d 6e 61 6d 65 3a 20 63 | 6f 6d 70 75 74 65 72 2d |-name: c|omputer-|
|000004b0| 6c 61 6e 67 2f 41 64 61 | 2f 70 72 6f 67 72 61 6d |lang/Ada|/program|
|000004c0| 6d 69 6e 67 2f 70 61 72 | 74 33 0d 0a 43 6f 6d 70 |ming/par|t3..Comp|
|000004d0| 2d 6c 61 6e 67 2d 61 64 | 61 2d 61 72 63 68 69 76 |-lang-ad|a-archiv|
|000004e0| 65 2d 6e 61 6d 65 3a 20 | 70 72 6f 67 72 61 6d 6d |e-name: |programm|
|000004f0| 69 6e 67 2f 70 61 72 74 | 33 0d 0a 50 6f 73 74 69 |ing/part|3..Posti|
|00000500| 6e 67 2d 46 72 65 71 75 | 65 6e 63 79 3a 20 6d 6f |ng-Frequ|ency: mo|
|00000510| 6e 74 68 6c 79 0d 0a 4c | 61 73 74 2d 6d 6f 64 69 |nthly..L|ast-modi|
|00000520| 66 69 65 64 3a 20 32 38 | 20 46 65 62 72 75 61 72 |fied: 28| Februar|
|00000530| 79 20 31 39 39 36 0d 0a | 4c 61 73 74 2d 70 6f 73 |y 1996..|Last-pos|
|00000540| 74 65 64 3a 20 32 36 20 | 4a 61 6e 75 61 72 79 20 |ted: 26 |January |
|00000550| 31 39 39 36 0d 0a 0d 0a | 20 20 20 20 20 20 20 20 |1996....| |
|00000560| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000570| 20 20 20 20 20 20 20 41 | 64 61 20 50 72 6f 67 72 | A|da Progr|
|00000580| 61 6d 6d 65 72 27 73 0d | 0a 20 20 20 20 20 20 20 |ammer's.|. |
|00000590| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000005a0| 46 72 65 71 75 65 6e 74 | 6c 79 20 41 73 6b 65 64 |Frequent|ly Asked|
|000005b0| 20 51 75 65 73 74 69 6f | 6e 73 20 28 46 41 51 29 | Questio|ns (FAQ)|
|000005c0| 0d 0a 0d 0a 20 20 20 49 | 4d 50 4f 52 54 41 4e 54 |.... I|MPORTANT|
|000005d0| 20 4e 4f 54 45 3a 20 4e | 6f 20 46 41 51 20 63 61 | NOTE: N|o FAQ ca|
|000005e0| 6e 20 73 75 62 73 74 69 | 74 75 74 65 20 66 6f 72 |n substi|tute for|
|000005f0| 20 72 65 61 6c 20 74 65 | 61 63 68 69 6e 67 20 61 | real te|aching a|
|00000600| 6e 64 0d 0a 20 20 20 64 | 6f 63 75 6d 65 6e 74 61 |nd.. d|ocumenta|
|00000610| 74 69 6f 6e 2e 20 54 68 | 65 72 65 20 69 73 20 61 |tion. Th|ere is a|
|00000620| 6e 20 61 6e 6e 6f 74 61 | 74 65 64 20 6c 69 73 74 |n annota|ted list|
|00000630| 20 6f 66 20 41 64 61 20 | 62 6f 6f 6b 73 20 69 6e | of Ada |books in|
|00000640| 20 74 68 65 0d 0a 20 20 | 20 63 6f 6d 70 61 6e 69 | the.. | compani|
|00000650| 6f 6e 20 63 6f 6d 70 2e | 6c 61 6e 67 2e 61 64 61 |on comp.|lang.ada|
|00000660| 20 46 41 51 2e 0d 0a 0d | 0a 54 68 69 73 20 69 73 | FAQ....|.This is|
|00000670| 20 70 61 72 74 20 33 20 | 6f 66 20 61 20 34 2d 70 | part 3 |of a 4-p|
|00000680| 61 72 74 20 70 6f 73 74 | 69 6e 67 2e 0d 0a 50 61 |art post|ing...Pa|
|00000690| 72 74 20 32 20 62 65 67 | 69 6e 73 20 77 69 74 68 |rt 2 beg|ins with|
|000006a0| 20 71 75 65 73 74 69 6f | 6e 20 35 2e 0d 0a 50 61 | questio|n 5...Pa|
|000006b0| 72 74 20 34 20 62 65 67 | 69 6e 73 20 77 69 74 68 |rt 4 beg|ins with|
|000006c0| 20 71 75 65 73 74 69 6f | 6e 20 39 2e 0d 0a 50 61 | questio|n 9...Pa|
|000006d0| 72 74 73 20 31 20 61 6e | 64 20 32 20 73 68 6f 75 |rts 1 an|d 2 shou|
|000006e0| 6c 64 20 62 65 20 74 68 | 65 20 70 72 65 76 69 6f |ld be th|e previo|
|000006f0| 75 73 20 70 6f 73 74 69 | 6e 67 73 20 69 6e 20 74 |us posti|ngs in t|
|00000700| 68 69 73 20 74 68 72 65 | 61 64 2e 0d 0a 50 61 72 |his thre|ad...Par|
|00000710| 74 20 34 20 73 68 6f 75 | 6c 64 20 62 65 20 74 68 |t 4 shou|ld be th|
|00000720| 65 20 6e 65 78 74 20 70 | 6f 73 74 69 6e 67 20 69 |e next p|osting i|
|00000730| 6e 20 74 68 69 73 20 74 | 68 72 65 61 64 2e 0d 0a |n this t|hread...|
|00000740| 0d 0a 20 20 20 20 52 65 | 63 65 6e 74 20 63 68 61 |.. Re|cent cha|
|00000750| 6e 67 65 73 20 74 6f 20 | 74 68 69 73 20 46 41 51 |nges to |this FAQ|
|00000760| 20 61 72 65 20 6c 69 73 | 74 65 64 20 69 6e 20 74 | are lis|ted in t|
|00000770| 68 65 20 66 69 72 73 74 | 20 73 65 63 74 69 6f 6e |he first| section|
|00000780| 20 61 66 74 65 72 20 74 | 68 65 20 74 61 62 6c 65 | after t|he table|
|00000790| 0d 0a 20 20 20 20 6f 66 | 20 63 6f 6e 74 65 6e 74 |.. of| content|
|000007a0| 73 20 28 69 6e 20 70 61 | 72 74 20 31 29 2e 20 54 |s (in pa|rt 1). T|
|000007b0| 68 69 73 20 64 6f 63 75 | 6d 65 6e 74 20 69 73 20 |his docu|ment is |
|000007c0| 75 6e 64 65 72 20 65 78 | 70 6c 69 63 69 74 20 63 |under ex|plicit c|
|000007d0| 6f 70 79 72 69 67 68 74 | 2e 0d 0a 0d 0a 0d 0a 36 |opyright|.......6|
|000007e0| 3a 20 41 64 61 20 4e 75 | 6d 65 72 69 63 73 0d 0a |: Ada Nu|merics..|
|000007f0| 0d 0a 36 2e 31 3a 20 57 | 68 65 72 65 20 63 61 6e |..6.1: W|here can|
|00000800| 20 49 20 66 69 6e 64 20 | 61 6e 6f 6e 79 6d 6f 75 | I find |anonymou|
|00000810| 73 20 66 74 70 20 73 69 | 74 65 73 20 66 6f 72 20 |s ftp si|tes for |
|00000820| 41 64 61 20 6d 61 74 68 | 20 70 61 63 6b 61 67 65 |Ada math| package|
|00000830| 73 3f 20 49 6e 20 70 61 | 72 74 69 63 75 6c 61 72 |s? In pa|rticular|
|00000840| 0d 0a 77 68 65 72 65 20 | 61 72 65 20 74 68 65 20 |..where |are the |
|00000850| 72 61 6e 64 6f 6d 20 6e | 75 6d 62 65 72 20 67 65 |random n|umber ge|
|00000860| 6e 65 72 61 74 6f 72 73 | 3f 0d 0a 0d 0a 0d 0a 20 |nerators|?...... |
|00000870| 20 20 66 74 70 2e 72 61 | 74 69 6f 6e 61 6c 2e 63 | ftp.ra|tional.c|
|00000880| 6f 6d 0d 0a 20 20 20 20 | 20 20 20 20 20 20 46 72 |om.. | Fr|
|00000890| 65 65 77 61 72 65 20 76 | 65 72 73 69 6f 6e 20 6f |eeware v|ersion o|
|000008a0| 66 20 74 68 65 20 49 53 | 4f 20 6d 61 74 68 20 70 |f the IS|O math p|
|000008b0| 61 63 6b 61 67 65 73 20 | 6f 6e 20 52 61 74 69 6f |ackages |on Ratio|
|000008c0| 6e 61 6c 27 73 20 46 54 | 50 0d 0a 20 20 20 20 20 |nal's FT|P.. |
|000008d0| 20 20 20 20 20 73 65 72 | 76 65 72 2e 20 49 74 27 | ser|ver. It'|
|000008e0| 73 20 61 20 62 69 6e 64 | 69 6e 67 20 6f 76 65 72 |s a bind|ing over|
|000008f0| 20 74 68 65 20 43 20 4d | 61 74 68 20 6c 69 62 72 | the C M|ath libr|
|00000900| 61 72 79 2c 20 69 6e 0d | 0a 20 20 20 20 20 20 20 |ary, in.|. |
|00000910| 20 20 20 70 75 62 6c 69 | 63 2f 61 70 65 78 2f 66 | publi|c/apex/f|
|00000920| 72 65 65 77 61 72 65 2f | 6d 61 74 68 5f 6c 69 62 |reeware/|math_lib|
|00000930| 2e 74 61 72 2e 5a 0d 0a | 0d 0a 20 20 20 61 72 63 |.tar.Z..|.. arc|
|00000940| 68 69 6d 65 64 65 73 2e | 6e 6f 73 63 2e 6d 69 6c |himedes.|nosc.mil|
|00000950| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 53 74 75 66 |.. | Stuf|
|00000960| 66 20 6f 66 20 68 69 67 | 68 20 71 75 61 6c 69 74 |f of hig|h qualit|
|00000970| 79 20 69 6e 20 70 75 62 | 2f 61 64 61 20 54 68 65 |y in pub|/ada The|
|00000980| 20 72 61 6e 64 6f 6d 20 | 6e 75 6d 62 65 72 20 67 | random |number g|
|00000990| 65 6e 65 72 61 74 6f 72 | 0d 0a 20 20 20 20 20 20 |enerator|.. |
|000009a0| 20 20 20 20 61 6e 64 20 | 72 61 6e 64 6f 6d 20 64 | and |random d|
|000009b0| 65 76 69 61 74 65 73 20 | 61 72 65 20 72 65 63 6f |eviates |are reco|
|000009c0| 6d 6d 65 6e 64 65 64 2e | 20 54 68 65 73 65 20 61 |mmended.| These a|
|000009d0| 72 65 20 6d 69 72 72 6f | 72 65 64 20 61 74 20 74 |re mirro|red at t|
|000009e0| 68 65 0d 0a 20 20 20 20 | 20 20 20 20 20 20 6e 65 |he.. | ne|
|000009f0| 78 74 20 73 69 74 65 2c | 20 77 75 61 72 63 68 69 |xt site,| wuarchi|
|00000a00| 76 65 2e 0d 0a 0d 0a 20 | 20 20 77 75 61 72 63 68 |ve..... | wuarch|
|00000a10| 69 76 65 2e 77 75 73 74 | 6c 2e 65 64 75 0d 0a 20 |ive.wust|l.edu.. |
|00000a20| 20 20 20 20 20 20 20 20 | 20 53 69 74 65 20 6f 66 | | Site of|
|00000a30| 20 50 41 4c 2c 20 74 68 | 65 20 50 75 62 6c 69 63 | PAL, th|e Public|
|00000a40| 20 41 64 61 20 4c 69 62 | 72 61 72 79 3a 20 6d 61 | Ada Lib|rary: ma|
|00000a50| 74 68 20 72 6f 75 74 69 | 6e 65 73 20 73 63 61 74 |th routi|nes scat|
|00000a60| 74 65 72 65 64 0d 0a 20 | 20 20 20 20 20 20 20 20 |tered.. | |
|00000a70| 20 61 62 6f 75 74 20 69 | 6e 20 74 68 65 20 64 69 | about i|n the di|
|00000a80| 72 65 63 74 6f 72 69 65 | 73 20 75 6e 64 65 72 20 |rectorie|s under |
|00000a90| 6c 61 6e 67 75 61 67 65 | 73 2f 61 64 61 20 69 6e |language|s/ada in|
|00000aa0| 20 70 61 72 74 69 63 75 | 6c 61 72 2c 20 69 6e 0d | particu|lar, in.|
|00000ab0| 0a 20 20 20 20 20 20 20 | 20 20 20 73 75 62 64 69 |. | subdi|
|00000ac0| 72 65 63 74 6f 72 79 20 | 73 77 63 6f 6d 70 73 0d |rectory |swcomps.|
|00000ad0| 0a 0d 0a 20 20 20 73 6f | 75 72 63 65 2e 61 73 73 |... so|urce.ass|
|00000ae0| 65 74 2e 63 6f 6d 0d 0a | 20 20 20 20 20 20 20 20 |et.com..| |
|00000af0| 20 20 54 68 69 73 20 69 | 73 20 6e 6f 74 20 61 6e | This i|s not an|
|00000b00| 20 61 6e 6f 6e 79 6d 6f | 75 73 20 66 74 70 20 73 | anonymo|us ftp s|
|00000b10| 69 74 65 20 66 6f 72 20 | 6d 61 74 68 20 73 6f 66 |ite for |math sof|
|00000b20| 74 77 61 72 65 2e 20 57 | 68 61 74 20 79 6f 75 0d |tware. W|hat you.|
|00000b30| 0a 20 20 20 20 20 20 20 | 20 20 20 73 68 6f 75 6c |. | shoul|
|00000b40| 64 20 64 6f 20 69 73 20 | 6c 6f 67 20 6f 6e 20 61 |d do is |log on a|
|00000b50| 6e 6f 6e 79 6d 6f 75 73 | 6c 79 20 75 6e 64 65 72 |nonymous|ly under|
|00000b60| 20 66 74 70 2c 20 61 6e | 64 20 64 6f 77 6e 6c 6f | ftp, an|d downlo|
|00000b70| 61 64 20 74 68 65 0d 0a | 20 20 20 20 20 20 20 20 |ad the..| |
|00000b80| 20 20 66 69 6c 65 20 61 | 73 73 65 74 2e 66 61 71 | file a|sset.faq|
|00000b90| 20 66 72 6f 6d 20 74 68 | 65 20 64 69 72 65 63 74 | from th|e direct|
|00000ba0| 6f 72 79 20 70 75 62 2e | 20 54 68 69 73 20 77 69 |ory pub.| This wi|
|00000bb0| 6c 6c 20 74 65 6c 6c 20 | 79 6f 75 20 68 6f 77 0d |ll tell |you how.|
|00000bc0| 0a 20 20 20 20 20 20 20 | 20 20 20 74 6f 20 67 65 |. | to ge|
|00000bd0| 74 20 61 6e 20 61 63 63 | 6f 75 6e 74 2e 0d 0a 0d |t an acc|ount....|
|00000be0| 0a 20 20 20 66 74 70 2e | 63 73 2e 6b 75 6c 65 75 |. ftp.|cs.kuleu|
|00000bf0| 76 65 6e 2e 61 63 2e 62 | 65 0d 0a 20 20 20 20 20 |ven.ac.b|e.. |
|00000c00| 20 20 20 20 20 47 6f 20 | 74 6f 20 64 69 72 65 63 | Go |to direc|
|00000c10| 74 6f 72 79 20 70 75 62 | 2f 41 64 61 2d 42 65 6c |tory pub|/Ada-Bel|
|00000c20| 67 69 75 6d 2f 63 64 72 | 6f 6d 2e 20 54 68 65 72 |gium/cdr|om. Ther|
|00000c30| 65 27 73 20 61 20 63 6f | 6c 6c 65 63 74 69 6f 6e |e's a co|llection|
|00000c40| 20 6f 66 0d 0a 20 20 20 | 20 20 20 20 20 20 20 6d | of.. | m|
|00000c50| 61 74 68 20 69 6e 74 65 | 6e 73 69 76 65 20 73 6f |ath inte|nsive so|
|00000c60| 66 74 77 61 72 65 20 69 | 6e 20 64 69 72 65 63 74 |ftware i|n direct|
|00000c70| 6f 72 79 20 73 77 63 6f | 6d 70 73 2e 20 4d 69 72 |ory swco|mps. Mir|
|00000c80| 72 6f 72 73 20 73 6f 6d | 65 20 6f 66 0d 0a 20 20 |rors som|e of.. |
|00000c90| 20 20 20 20 20 20 20 20 | 50 41 4c 20 61 74 20 77 | |PAL at w|
|00000ca0| 75 61 72 63 68 69 76 65 | 2e 77 75 73 74 6c 2e 65 |uarchive|.wustl.e|
|00000cb0| 64 75 2e 0d 0a 0d 0a 20 | 20 20 73 77 2d 65 6e 67 |du..... | sw-eng|
|00000cc0| 2e 66 61 6c 6c 73 2d 63 | 68 75 72 63 68 2e 76 61 |.falls-c|hurch.va|
|00000cd0| 2e 75 73 0d 0a 20 20 20 | 20 20 20 20 20 20 20 47 |.us.. | G|
|00000ce0| 6f 20 74 6f 20 64 69 72 | 65 63 74 6f 72 79 20 70 |o to dir|ectory p|
|00000cf0| 75 62 6c 69 63 2f 41 64 | 61 49 43 2f 73 6f 75 72 |ublic/Ad|aIC/sour|
|00000d00| 63 65 2d 63 6f 64 65 2f | 62 69 6e 64 69 6e 67 73 |ce-code/|bindings|
|00000d10| 2f 41 44 41 52 2d 62 69 | 6e 64 69 6e 67 73 0d 0a |/ADAR-bi|ndings..|
|00000d20| 20 20 20 20 20 20 20 20 | 20 20 74 6f 20 66 69 6e | | to fin|
|00000d30| 64 20 65 78 74 65 6e 64 | 65 64 2d 70 72 65 63 69 |d extend|ed-preci|
|00000d40| 73 69 6f 6e 20 64 65 63 | 69 6d 61 6c 20 61 72 69 |sion dec|imal ari|
|00000d50| 74 68 6d 65 74 69 63 20 | 28 75 70 20 74 6f 20 31 |thmetic |(up to 1|
|00000d60| 38 0d 0a 20 20 20 20 20 | 20 20 20 20 20 64 69 67 |8.. | dig|
|00000d70| 69 74 73 29 2e 20 49 6e | 63 6c 75 64 65 73 20 66 |its). In|cludes f|
|00000d80| 61 63 69 6c 69 74 69 65 | 73 20 66 6f 72 20 43 4f |acilitie|s for CO|
|00000d90| 42 4f 4c 2d 6c 69 6b 65 | 20 66 6f 72 6d 61 74 74 |BOL-like| formatt|
|00000da0| 65 64 20 6f 75 74 70 75 | 74 2e 0d 0a 0d 0a 0d 0a |ed outpu|t.......|
|00000db0| 36 2e 32 3a 20 48 6f 77 | 20 63 61 6e 20 49 20 77 |6.2: How| can I w|
|00000dc0| 72 69 74 65 20 70 6f 72 | 74 61 62 6c 65 20 63 6f |rite por|table co|
|00000dd0| 64 65 20 69 6e 20 41 64 | 61 20 38 33 20 75 73 69 |de in Ad|a 83 usi|
|00000de0| 6e 67 20 70 72 65 64 65 | 66 69 6e 65 64 20 74 79 |ng prede|fined ty|
|00000df0| 70 65 73 20 6c 69 6b 65 | 20 46 6c 6f 61 74 0d 0a |pes like| Float..|
|00000e00| 61 6e 64 20 4c 6f 6e 67 | 5f 46 6c 6f 61 74 3f 20 |and Long|_Float? |
|00000e10| 4c 69 6b 65 77 69 73 65 | 2c 20 68 6f 77 20 63 61 |Likewise|, how ca|
|00000e20| 6e 20 49 20 77 72 69 74 | 65 20 70 6f 72 74 61 62 |n I writ|e portab|
|00000e30| 6c 65 20 63 6f 64 65 20 | 74 68 61 74 20 75 73 65 |le code |that use|
|00000e40| 73 20 4d 61 74 68 0d 0a | 66 75 6e 63 74 69 6f 6e |s Math..|function|
|00000e50| 73 20 6c 69 6b 65 20 53 | 69 6e 20 61 6e 64 20 4c |s like S|in and L|
|00000e60| 6f 67 20 74 68 61 74 20 | 61 72 65 20 64 65 66 69 |og that |are defi|
|00000e70| 6e 65 64 20 66 6f 72 20 | 46 6c 6f 61 74 20 61 6e |ned for |Float an|
|00000e80| 64 20 4c 6f 6e 67 5f 46 | 6c 6f 61 74 3f 0d 0a 0d |d Long_F|loat?...|
|00000e90| 0a 20 20 20 28 66 72 6f | 6d 20 4a 6f 6e 61 74 68 |. (fro|m Jonath|
|00000ea0| 61 6e 20 50 61 72 6b 65 | 72 29 0d 0a 0d 0a 20 20 |an Parke|r).... |
|00000eb0| 20 41 64 61 20 38 33 20 | 77 61 73 20 73 6c 6f 77 | Ada 83 |was slow|
|00000ec0| 20 74 6f 20 61 72 72 69 | 76 65 20 61 74 20 61 20 | to arri|ve at a |
|00000ed0| 73 74 61 6e 64 61 72 64 | 20 6e 61 6d 69 6e 67 20 |standard| naming |
|00000ee0| 63 6f 6e 76 65 6e 74 69 | 6f 6e 20 66 6f 72 0d 0a |conventi|on for..|
|00000ef0| 20 20 20 65 6c 65 6d 65 | 6e 74 61 72 79 20 6d 61 | eleme|ntary ma|
|00000f00| 74 68 20 66 75 6e 63 74 | 69 6f 6e 73 20 61 6e 64 |th funct|ions and|
|00000f10| 20 63 6f 6d 70 6c 65 78 | 20 6e 75 6d 62 65 72 73 | complex| numbers|
|00000f20| 2e 20 46 75 72 74 68 65 | 72 6d 6f 72 65 2c 20 79 |. Furthe|rmore, y|
|00000f30| 6f 75 27 6c 6c 0d 0a 20 | 20 20 66 69 6e 64 20 74 |ou'll.. | find t|
|00000f40| 68 61 74 20 73 6f 6d 65 | 20 63 6f 6d 70 69 6c 65 |hat some| compile|
|00000f50| 72 73 20 63 61 6c 6c 20 | 74 68 65 20 36 34 2d 62 |rs call |the 64-b|
|00000f60| 69 74 20 66 6c 6f 61 74 | 69 6e 67 20 70 6f 69 6e |it float|ing poin|
|00000f70| 74 20 74 79 70 65 0d 0a | 20 20 20 4c 6f 6e 67 5f |t type..| Long_|
|00000f80| 46 6c 6f 61 74 3b 20 6f | 74 68 65 72 20 63 6f 6d |Float; o|ther com|
|00000f90| 70 69 6c 65 72 73 20 63 | 61 6c 6c 20 69 74 20 46 |pilers c|all it F|
|00000fa0| 6c 6f 61 74 2e 20 46 6f | 72 74 75 6e 61 74 65 6c |loat. Fo|rtunatel|
|00000fb0| 79 2c 20 69 74 20 69 73 | 20 65 61 73 79 20 74 6f |y, it is| easy to|
|00000fc0| 0d 0a 20 20 20 77 72 69 | 74 65 20 70 72 6f 67 72 |.. wri|te progr|
|00000fd0| 61 6d 73 20 69 6e 20 41 | 64 61 20 74 68 61 74 20 |ams in A|da that |
|00000fe0| 61 72 65 20 69 6e 64 65 | 70 65 6e 64 65 6e 74 20 |are inde|pendent |
|00000ff0| 6f 66 20 74 68 65 20 6e | 61 6d 69 6e 67 20 63 6f |of the n|aming co|
|00001000| 6e 76 65 6e 74 69 6f 6e | 73 0d 0a 20 20 20 66 6f |nvention|s.. fo|
|00001010| 72 20 66 6c 6f 61 74 69 | 6e 67 20 70 6f 69 6e 74 |r floati|ng point|
|00001020| 20 74 79 70 65 73 20 61 | 6e 64 20 69 6e 64 65 70 | types a|nd indep|
|00001030| 65 6e 64 65 6e 74 20 6f | 66 20 74 68 65 20 6e 61 |endent o|f the na|
|00001040| 6d 69 6e 67 20 63 6f 6e | 76 65 6e 74 69 6f 6e 73 |ming con|ventions|
|00001050| 20 6f 66 0d 0a 20 20 20 | 6d 61 74 68 20 66 75 6e | of.. |math fun|
|00001060| 63 74 69 6f 6e 73 20 64 | 65 66 69 6e 65 64 20 6f |ctions d|efined o|
|00001070| 6e 20 74 68 6f 73 65 20 | 74 79 70 65 73 2e 0d 0a |n those |types...|
|00001080| 0d 0a 20 20 20 4f 6e 65 | 20 6f 66 20 74 68 65 20 |.. One| of the |
|00001090| 63 6c 65 61 6e 65 73 74 | 20 77 61 79 73 20 69 73 |cleanest| ways is|
|000010a0| 20 74 6f 20 6d 61 6b 65 | 20 74 68 65 20 70 72 6f | to make| the pro|
|000010b0| 67 72 61 6d 20 67 65 6e | 65 72 69 63 3a 0d 0a 0d |gram gen|eric:...|
|000010c0| 0a 20 20 20 20 20 67 65 | 6e 65 72 69 63 0d 0a 20 |. ge|neric.. |
|000010d0| 20 20 20 20 20 20 74 79 | 70 65 20 52 65 61 6c 20 | ty|pe Real |
|000010e0| 69 73 20 64 69 67 69 74 | 73 20 3c 3e 3b 0d 0a 20 |is digit|s <>;.. |
|000010f0| 20 20 20 20 20 20 77 69 | 74 68 20 66 75 6e 63 74 | wi|th funct|
|00001100| 69 6f 6e 20 41 72 63 73 | 69 6e 20 28 58 20 3a 20 |ion Arcs|in (X : |
|00001110| 52 65 61 6c 29 20 72 65 | 74 75 72 6e 20 52 65 61 |Real) re|turn Rea|
|00001120| 6c 20 69 73 20 3c 3e 3b | 0d 0a 20 20 20 20 20 20 |l is <>;|.. |
|00001130| 20 77 69 74 68 20 66 75 | 6e 63 74 69 6f 6e 20 20 | with fu|nction |
|00001140| 20 20 4c 6f 67 20 28 58 | 20 3a 20 52 65 61 6c 29 | Log (X| : Real)|
|00001150| 20 72 65 74 75 72 6e 20 | 52 65 61 6c 20 69 73 20 | return |Real is |
|00001160| 3c 3e 3b 0d 0a 20 20 20 | 20 20 20 20 2d 2d 20 20 |<>;.. | -- |
|00001170| 54 68 69 73 20 69 73 20 | 74 68 65 20 6e 61 74 75 |This is |the natu|
|00001180| 72 61 6c 20 6c 6f 67 2c | 20 69 6e 76 65 72 73 65 |ral log,| inverse|
|00001190| 20 6f 66 20 45 78 70 28 | 58 29 2c 20 73 6f 6d 65 | of Exp(|X), some|
|000011a0| 74 69 6d 65 73 20 77 72 | 69 74 74 65 6e 20 4c 6e |times wr|itten Ln|
|000011b0| 28 58 29 2e 0d 0a 20 20 | 20 20 20 70 61 63 6b 61 |(X)... | packa|
|000011c0| 67 65 20 45 78 61 6d 70 | 6c 65 5f 31 20 69 73 0d |ge Examp|le_1 is.|
|000011d0| 0a 20 20 20 20 20 20 20 | 2e 2e 2e 0d 0a 20 20 20 |. |..... |
|000011e0| 20 20 65 6e 64 20 45 78 | 61 6d 70 6c 65 5f 31 3b | end Ex|ample_1;|
|000011f0| 0d 0a 0d 0a 0d 0a 20 20 | 20 53 6f 20 74 68 65 20 |...... | So the |
|00001200| 61 62 6f 76 65 20 70 61 | 63 6b 61 67 65 20 64 6f |above pa|ckage do|
|00001210| 65 73 6e 27 74 20 63 61 | 72 65 20 77 68 61 74 20 |esn't ca|re what |
|00001220| 74 68 65 20 6e 61 6d 65 | 20 6f 66 20 74 68 65 20 |the name| of the |
|00001230| 66 6c 6f 61 74 69 6e 67 | 20 70 6f 69 6e 74 0d 0a |floating| point..|
|00001240| 20 20 20 74 79 70 65 20 | 69 73 2c 20 6f 72 20 77 | type |is, or w|
|00001250| 68 61 74 20 70 61 63 6b | 61 67 65 20 74 68 65 20 |hat pack|age the |
|00001260| 4d 61 74 68 20 66 75 6e | 63 74 69 6f 6e 73 20 61 |Math fun|ctions a|
|00001270| 72 65 20 64 65 66 69 6e | 65 64 20 69 6e 2c 20 6a |re defin|ed in, j|
|00001280| 75 73 74 20 61 73 0d 0a | 20 20 20 6c 6f 6e 67 20 |ust as..| long |
|00001290| 61 73 20 74 68 65 20 66 | 6c 6f 61 74 69 6e 67 20 |as the f|loating |
|000012a0| 70 6f 69 6e 74 20 74 79 | 70 65 20 68 61 73 20 74 |point ty|pe has t|
|000012b0| 68 65 20 72 69 67 68 74 | 20 61 74 74 72 69 62 75 |he right| attribu|
|000012c0| 74 65 73 20 28 70 72 65 | 63 69 73 69 6f 6e 0d 0a |tes (pre|cision..|
|000012d0| 20 20 20 61 6e 64 20 72 | 61 6e 67 65 29 20 66 6f | and r|ange) fo|
|000012e0| 72 20 74 68 65 20 61 6c | 67 6f 72 69 74 68 6d 2c |r the al|gorithm,|
|000012f0| 20 61 6e 64 20 6c 69 6b | 65 77 69 73 65 20 74 68 | and lik|ewise th|
|00001300| 65 20 66 75 6e 63 74 69 | 6f 6e 73 2e 20 45 76 65 |e functi|ons. Eve|
|00001310| 72 79 74 68 69 6e 67 0d | 0a 20 20 20 69 6e 20 74 |rything.|. in t|
|00001320| 68 65 20 62 6f 64 79 20 | 6f 66 20 45 78 61 6d 70 |he body |of Examp|
|00001330| 6c 65 5f 31 20 69 73 20 | 77 72 69 74 74 65 6e 20 |le_1 is |written |
|00001340| 69 6e 20 74 65 72 6d 73 | 20 6f 66 20 74 68 65 20 |in terms| of the |
|00001350| 61 62 73 74 72 61 63 74 | 20 6e 61 6d 65 73 2c 0d |abstract| names,.|
|00001360| 0a 20 20 20 52 65 61 6c | 2c 20 41 72 63 73 69 6e |. Real|, Arcsin|
|00001370| 2c 20 61 6e 64 20 4c 6f | 67 2c 20 65 76 65 6e 20 |, and Lo|g, even |
|00001380| 74 68 6f 75 67 68 20 79 | 6f 75 20 69 6e 73 74 61 |though y|ou insta|
|00001390| 6e 74 69 61 74 65 20 69 | 74 20 77 69 74 68 20 63 |ntiate i|t with c|
|000013a0| 6f 6d 70 69 6c 65 72 0d | 0a 20 20 20 73 70 65 63 |ompiler.|. spec|
|000013b0| 69 66 69 63 20 6e 61 6d | 65 73 20 74 68 61 74 20 |ific nam|es that |
|000013c0| 63 61 6e 20 6c 6f 6f 6b | 20 76 65 72 79 20 64 69 |can look| very di|
|000013d0| 66 66 65 72 65 6e 74 3a | 0d 0a 0d 0a 20 20 20 20 |fferent:|.... |
|000013e0| 20 20 70 61 63 6b 61 67 | 65 20 53 70 65 63 69 61 | packag|e Specia|
|000013f0| 6c 5f 43 61 73 65 20 69 | 73 20 6e 65 77 20 45 78 |l_Case i|s new Ex|
|00001400| 61 6d 70 6c 65 5f 31 20 | 28 4c 6f 6e 67 5f 46 6c |ample_1 |(Long_Fl|
|00001410| 6f 61 74 2c 20 41 73 69 | 6e 2c 20 4c 6e 29 3b 0d |oat, Asi|n, Ln);.|
|00001420| 0a 0d 0a 0d 0a 20 20 20 | 54 68 65 20 6e 75 6d 65 |..... |The nume|
|00001430| 72 69 63 61 6c 20 61 6c | 67 6f 72 69 74 68 6d 73 |rical al|gorithms|
|00001440| 20 69 6d 70 6c 65 6d 65 | 6e 74 65 64 20 62 79 20 | impleme|nted by |
|00001450| 67 65 6e 65 72 69 63 73 | 20 6c 69 6b 65 20 45 78 |generics| like Ex|
|00001460| 61 6d 70 6c 65 5f 31 20 | 63 61 6e 0d 0a 20 20 20 |ample_1 |can.. |
|00001470| 75 73 75 61 6c 6c 79 20 | 62 65 20 6d 61 64 65 20 |usually |be made |
|00001480| 74 6f 20 77 6f 72 6b 20 | 66 6f 72 20 61 20 72 61 |to work |for a ra|
|00001490| 6e 67 65 20 6f 66 20 66 | 6c 6f 61 74 69 6e 67 20 |nge of f|loating |
|000014a0| 70 6f 69 6e 74 20 70 72 | 65 63 69 73 69 6f 6e 73 |point pr|ecisions|
|000014b0| 2e 20 41 0d 0a 20 20 20 | 77 65 6c 6c 20 77 72 69 |. A.. |well wri|
|000014c0| 74 74 65 6e 20 70 72 6f | 67 72 61 6d 20 77 69 6c |tten pro|gram wil|
|000014d0| 6c 20 70 65 72 66 6f 72 | 6d 20 74 65 73 74 73 20 |l perfor|m tests |
|000014e0| 6f 6e 20 52 65 61 6c 20 | 74 6f 20 72 65 6a 65 63 |on Real |to rejec|
|000014f0| 74 0d 0a 20 20 20 69 6e | 73 74 61 6e 74 69 61 74 |t.. in|stantiat|
|00001500| 69 6f 6e 73 20 6f 66 20 | 45 78 61 6d 70 6c 65 5f |ions of |Example_|
|00001510| 31 20 69 66 20 74 68 65 | 20 66 6c 6f 61 74 69 6e |1 if the| floatin|
|00001520| 67 20 70 6f 69 6e 74 73 | 20 74 79 70 65 20 69 73 |g points| type is|
|00001530| 20 6a 75 64 67 65 64 0d | 0a 20 20 20 69 6e 61 64 | judged.|. inad|
|00001540| 65 71 75 61 74 65 2e 20 | 54 68 65 20 74 65 73 74 |equate. |The test|
|00001550| 73 20 6d 61 79 20 63 68 | 65 63 6b 20 74 68 65 20 |s may ch|eck the |
|00001560| 6e 75 6d 62 65 72 20 6f | 66 20 64 69 67 69 74 73 |number o|f digits|
|00001570| 20 6f 66 20 70 72 65 63 | 69 73 69 6f 6e 20 69 6e | of prec|ision in|
|00001580| 0d 0a 20 20 20 52 65 61 | 6c 20 28 52 65 61 6c 27 |.. Rea|l (Real'|
|00001590| 44 69 67 69 74 73 29 20 | 6f 72 20 74 68 65 20 72 |Digits) |or the r|
|000015a0| 61 6e 67 65 20 6f 66 20 | 52 65 61 6c 20 28 52 65 |ange of |Real (Re|
|000015b0| 61 6c 27 46 69 72 73 74 | 2c 20 52 65 61 6c 27 4c |al'First|, Real'L|
|000015c0| 61 73 74 29 20 6f 72 20 | 74 68 65 0d 0a 20 20 20 |ast) or |the.. |
|000015d0| 6c 61 72 67 65 73 74 20 | 65 78 70 6f 6e 65 6e 74 |largest |exponent|
|000015e0| 20 6f 66 20 74 68 65 20 | 73 65 74 20 6f 66 20 73 | of the |set of s|
|000015f0| 61 66 65 20 6e 75 6d 62 | 65 72 73 20 28 52 65 61 |afe numb|ers (Rea|
|00001600| 6c 27 53 61 66 65 5f 45 | 6d 61 78 29 2c 20 65 74 |l'Safe_E|max), et|
|00001610| 63 2e 0d 0a 20 20 20 54 | 68 65 73 65 20 74 65 73 |c... T|hese tes|
|00001620| 74 73 20 61 72 65 20 6f | 66 74 65 6e 20 70 6c 61 |ts are o|ften pla|
|00001630| 63 65 64 20 61 66 74 65 | 72 20 74 68 65 20 62 65 |ced afte|r the be|
|00001640| 67 69 6e 20 73 74 61 74 | 65 6d 65 6e 74 20 6f 66 |gin stat|ement of|
|00001650| 20 70 61 63 6b 61 67 65 | 0d 0a 20 20 20 62 6f 64 | package|.. bod|
|00001660| 79 2c 20 61 73 20 69 6e | 3a 0d 0a 0d 0a 20 20 20 |y, as in|:.... |
|00001670| 20 20 70 61 63 6b 61 67 | 65 20 62 6f 64 79 20 45 | packag|e body E|
|00001680| 78 61 6d 70 6c 65 5f 31 | 20 69 73 0d 0a 20 20 20 |xample_1| is.. |
|00001690| 20 20 20 20 2e 2e 2e 0d | 0a 20 20 20 20 20 62 65 | ....|. be|
|000016a0| 67 69 6e 0d 0a 20 20 20 | 20 20 20 20 69 66 20 28 |gin.. | if (|
|000016b0| 52 65 61 6c 27 4d 61 63 | 68 69 6e 65 5f 4d 61 6e |Real'Mac|hine_Man|
|000016c0| 74 69 73 73 61 20 3e 20 | 36 30 29 20 6f 72 20 28 |tissa > |60) or (|
|000016d0| 52 65 61 6c 27 4d 61 63 | 68 69 6e 65 5f 45 6d 61 |Real'Mac|hine_Ema|
|000016e0| 78 20 3c 20 32 35 36 29 | 20 74 68 65 6e 0d 0a 20 |x < 256)| then.. |
|000016f0| 20 20 20 20 20 20 20 20 | 72 61 69 73 65 20 50 72 | |raise Pr|
|00001700| 6f 67 72 61 6d 5f 45 72 | 72 6f 72 3b 0d 0a 20 20 |ogram_Er|ror;.. |
|00001710| 20 20 20 20 20 65 6e 64 | 20 69 66 3b 0d 0a 20 20 | end| if;.. |
|00001720| 20 20 20 65 6e 64 20 45 | 78 61 6d 70 6c 65 5f 31 | end E|xample_1|
|00001730| 3b 0d 0a 0d 0a 0d 0a 20 | 20 20 4d 61 6b 69 6e 67 |;...... | Making|
|00001740| 20 61 6e 20 61 6c 67 6f | 72 69 74 68 6d 20 61 73 | an algo|rithm as|
|00001750| 20 61 62 73 74 72 61 63 | 74 20 61 73 20 70 6f 73 | abstrac|t as pos|
|00001760| 73 69 62 6c 65 2c 20 28 | 69 6e 64 65 70 65 6e 64 |sible, (|independ|
|00001770| 65 6e 74 20 6f 66 20 64 | 61 74 61 0d 0a 20 20 20 |ent of d|ata.. |
|00001780| 74 79 70 65 73 20 61 73 | 20 6d 75 63 68 20 61 73 |types as| much as|
|00001790| 20 70 6f 73 73 69 62 6c | 65 29 20 63 61 6e 20 64 | possibl|e) can d|
|000017a0| 6f 20 61 20 6c 6f 74 20 | 74 6f 20 69 6d 70 72 6f |o a lot |to impro|
|000017b0| 76 65 20 74 68 65 20 71 | 75 61 6c 69 74 79 20 6f |ve the q|uality o|
|000017c0| 66 20 74 68 65 0d 0a 20 | 20 20 63 6f 64 65 2e 20 |f the.. | code. |
|000017d0| 53 75 70 70 6f 72 74 20 | 66 6f 72 20 61 62 73 74 |Support |for abst|
|000017e0| 72 61 63 74 69 6f 6e 20 | 69 73 20 6f 6e 65 20 6f |raction |is one o|
|000017f0| 66 20 74 68 65 20 6d 61 | 6e 79 20 74 68 69 6e 67 |f the ma|ny thing|
|00001800| 73 20 41 64 61 2d 70 68 | 69 6c 65 73 0d 0a 20 20 |s Ada-ph|iles.. |
|00001810| 20 66 69 6e 64 20 73 6f | 20 61 74 74 72 61 63 74 | find so| attract|
|00001820| 69 76 65 20 61 62 6f 75 | 74 20 74 68 65 20 6c 61 |ive abou|t the la|
|00001830| 6e 67 75 61 67 65 2e 20 | 54 68 65 20 64 65 73 69 |nguage. |The desi|
|00001840| 67 6e 65 72 73 20 6f 66 | 20 41 64 61 20 39 35 0d |gners of| Ada 95.|
|00001850| 0a 20 20 20 72 65 63 6f | 67 6e 69 7a 65 64 20 74 |. reco|gnized t|
|00001860| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 61 62 73 74 |he value| of abst|
|00001870| 72 61 63 74 69 6f 6e 20 | 69 6e 20 74 68 65 20 64 |raction |in the d|
|00001880| 65 73 69 67 6e 20 6f 66 | 20 6e 75 6d 65 72 69 63 |esign of| numeric|
|00001890| 0d 0a 20 20 20 61 6c 67 | 6f 72 69 74 68 6d 73 20 |.. alg|orithms |
|000018a0| 61 6e 64 20 68 61 76 65 | 20 67 65 6e 65 72 61 6c |and have| general|
|000018b0| 69 7a 65 64 20 6d 61 6e | 79 20 6f 66 20 74 68 65 |ized man|y of the|
|000018c0| 20 66 65 61 74 75 72 65 | 73 20 6f 66 20 74 68 65 | feature|s of the|
|000018d0| 20 27 38 33 20 6d 6f 64 | 65 6c 2e 0d 0a 20 20 20 | '83 mod|el... |
|000018e0| 46 6f 72 20 65 78 61 6d | 70 6c 65 2c 20 6e 6f 20 |For exam|ple, no |
|000018f0| 6d 61 74 74 65 72 20 77 | 68 61 74 20 66 6c 6f 61 |matter w|hat floa|
|00001900| 74 69 6e 67 20 70 6f 69 | 6e 74 20 74 79 70 65 20 |ting poi|nt type |
|00001910| 79 6f 75 20 69 6e 73 74 | 61 6e 74 69 61 74 65 0d |you inst|antiate.|
|00001920| 0a 20 20 20 45 78 61 6d | 70 6c 65 5f 31 20 77 69 |. Exam|ple_1 wi|
|00001930| 74 68 2c 20 41 64 61 20 | 39 35 20 70 72 6f 76 69 |th, Ada |95 provi|
|00001940| 64 65 73 20 79 6f 75 20 | 77 69 74 68 20 66 75 6e |des you |with fun|
|00001950| 63 74 69 6f 6e 73 20 66 | 6f 72 20 65 78 61 6d 69 |ctions f|or exami|
|00001960| 6e 69 6e 67 20 74 68 65 | 0d 0a 20 20 20 65 78 70 |ning the|.. exp|
|00001970| 6f 6e 65 6e 74 20 61 6e | 64 20 74 68 65 20 6d 61 |onent an|d the ma|
|00001980| 6e 74 69 73 73 61 73 20 | 6f 66 20 74 68 65 20 6e |ntissas |of the n|
|00001990| 75 6d 62 65 72 73 2c 20 | 66 6f 72 20 74 72 75 6e |umbers, |for trun|
|000019a0| 63 61 74 69 6e 67 2c 20 | 64 65 74 65 72 6d 69 6e |cating, |determin|
|000019b0| 69 6e 67 0d 0a 20 20 20 | 65 78 61 63 74 20 72 65 |ing.. |exact re|
|000019c0| 6d 61 69 6e 64 65 72 73 | 2c 20 73 63 61 6c 69 6e |mainders|, scalin|
|000019d0| 67 20 65 78 70 6f 6e 65 | 6e 74 73 2c 20 61 6e 64 |g expone|nts, and|
|000019e0| 20 73 6f 20 6f 6e 2e 20 | 28 49 6e 20 74 68 65 20 | so on. |(In the |
|000019f0| 62 6f 64 79 20 6f 66 0d | 0a 20 20 20 45 78 61 6d |body of.|. Exam|
|00001a00| 70 6c 65 5f 31 2c 20 61 | 6e 64 20 69 6e 20 69 74 |ple_1, a|nd in it|
|00001a10| 73 20 73 70 65 63 20 61 | 6c 73 6f 20 6f 66 20 63 |s spec a|lso of c|
|00001a20| 6f 75 72 73 65 2c 20 74 | 68 65 73 65 20 66 75 6e |ourse, t|hese fun|
|00001a30| 63 74 69 6f 6e 73 20 61 | 72 65 0d 0a 20 20 20 77 |ctions a|re.. w|
|00001a40| 72 69 74 74 65 6e 2c 20 | 72 65 73 70 65 63 74 69 |ritten, |respecti|
|00001a50| 76 65 6c 79 3a 20 52 65 | 61 6c 27 45 78 70 6f 6e |vely: Re|al'Expon|
|00001a60| 65 6e 74 28 58 29 2c 20 | 52 65 61 6c 27 46 72 61 |ent(X), |Real'Fra|
|00001a70| 63 74 69 6f 6e 28 58 29 | 2c 0d 0a 20 20 20 52 65 |ction(X)|,.. Re|
|00001a80| 61 6c 27 54 72 75 6e 63 | 61 74 69 6f 6e 28 58 29 |al'Trunc|ation(X)|
|00001a90| 2c 20 52 65 61 6c 27 52 | 65 6d 61 69 6e 64 65 72 |, Real'R|emainder|
|00001aa0| 28 58 2c 59 29 2c 20 52 | 65 61 6c 27 53 63 61 6c |(X,Y), R|eal'Scal|
|00001ab0| 69 6e 67 28 58 2c 20 4e | 29 2e 20 54 68 65 72 65 |ing(X, N|). There|
|00001ac0| 20 61 72 65 0d 0a 20 20 | 20 6f 74 68 65 72 73 2e | are.. | others.|
|00001ad0| 29 20 41 6c 73 6f 2c 20 | 69 6e 20 70 61 63 6b 61 |) Also, |in packa|
|00001ae0| 67 65 20 45 78 61 6d 70 | 6c 65 5f 31 2c 20 41 64 |ge Examp|le_1, Ad|
|00001af0| 61 20 39 35 20 6c 65 74 | 73 20 79 6f 75 20 64 6f |a 95 let|s you do|
|00001b00| 20 74 68 65 20 61 72 69 | 74 68 6d 65 74 69 63 0d | the ari|thmetic.|
|00001b10| 0a 20 20 20 6f 6e 20 74 | 68 65 20 62 61 73 65 20 |. on t|he base |
|00001b20| 74 79 70 65 20 6f 66 20 | 52 65 61 6c 20 28 63 61 |type of |Real (ca|
|00001b30| 6c 6c 65 64 20 52 65 61 | 6c 27 42 61 73 65 29 20 |lled Rea|l'Base) |
|00001b40| 77 68 69 63 68 20 69 73 | 20 6c 69 61 62 6c 65 20 |which is| liable |
|00001b50| 74 6f 20 68 61 76 65 0d | 0a 20 20 20 67 72 65 61 |to have.|. grea|
|00001b60| 74 65 72 20 70 72 65 63 | 69 73 69 6f 6e 20 61 6e |ter prec|ision an|
|00001b70| 64 20 72 61 6e 67 65 20 | 74 68 61 6e 20 74 79 70 |d range |than typ|
|00001b80| 65 20 52 65 61 6c 2e 0d | 0a 0d 0a 20 20 20 49 74 |e Real..|... It|
|00001b90| 20 69 73 20 72 61 72 65 | 20 74 6f 20 73 65 65 20 | is rare| to see |
|00001ba0| 61 20 70 65 72 66 6f 72 | 6d 61 6e 63 65 20 6c 6f |a perfor|mance lo|
|00001bb0| 73 73 20 77 68 65 6e 20 | 75 73 69 6e 67 20 67 65 |ss when |using ge|
|00001bc0| 6e 65 72 69 63 73 20 6c | 69 6b 65 20 74 68 69 73 |nerics l|ike this|
|00001bd0| 2e 0d 0a 20 20 20 48 6f | 77 65 76 65 72 2c 20 69 |... Ho|wever, i|
|00001be0| 66 20 74 68 65 72 65 20 | 69 73 20 61 6e 20 75 6e |f there |is an un|
|00001bf0| 61 63 63 65 70 74 61 62 | 6c 65 20 70 65 72 66 6f |acceptab|le perfo|
|00001c00| 72 6d 61 6e 63 65 20 68 | 69 74 2c 20 6f 72 20 69 |rmance h|it, or i|
|00001c10| 66 20 67 65 6e 65 72 69 | 63 73 0d 0a 20 20 20 63 |f generi|cs.. c|
|00001c20| 61 6e 6e 6f 74 20 62 65 | 20 75 73 65 64 20 66 6f |annot be| used fo|
|00001c30| 72 20 73 6f 6d 65 20 6f | 74 68 65 72 20 72 65 61 |r some o|ther rea|
|00001c40| 73 6f 6e 2c 20 74 68 65 | 6e 20 73 75 62 74 79 70 |son, the|n subtyp|
|00001c50| 69 6e 67 20 61 6e 64 20 | 72 65 6e 61 6d 69 6e 67 |ing and |renaming|
|00001c60| 20 77 69 6c 6c 0d 0a 20 | 20 20 64 6f 20 74 68 65 | will.. | do the|
|00001c70| 20 6a 6f 62 2e 20 48 65 | 72 65 20 69 73 20 61 6e | job. He|re is an|
|00001c80| 20 65 78 61 6d 70 6c 65 | 20 6f 66 20 72 65 6e 61 | example| of rena|
|00001c90| 6d 69 6e 67 3a 0d 0a 0d | 0a 20 20 20 20 20 77 69 |ming:...|. wi|
|00001ca0| 74 68 20 53 6f 6d 65 6f | 6e 65 73 5f 4d 61 74 68 |th Someo|nes_Math|
|00001cb0| 5f 4c 69 62 3b 0d 0a 20 | 20 20 20 20 70 72 6f 63 |_Lib;.. | proc|
|00001cc0| 65 64 75 72 65 20 45 78 | 61 6d 70 6c 65 5f 32 20 |edure Ex|ample_2 |
|00001cd0| 69 73 0d 0a 0d 0a 20 20 | 20 20 20 20 20 73 75 62 |is.... | sub|
|00001ce0| 74 79 70 65 20 52 65 61 | 6c 20 69 73 20 4c 6f 6e |type Rea|l is Lon|
|00001cf0| 67 5f 46 6c 6f 61 74 3b | 0d 0a 0d 0a 20 20 20 20 |g_Float;|.... |
|00001d00| 20 20 20 70 61 63 6b 61 | 67 65 20 20 4d 61 74 68 | packa|ge Math|
|00001d10| 20 72 65 6e 61 6d 65 73 | 20 53 6f 6d 65 6f 6e 65 | renames| Someone|
|00001d20| 73 5f 4d 61 74 68 5f 4c | 69 62 3b 0d 0a 20 20 20 |s_Math_L|ib;.. |
|00001d30| 20 20 20 20 66 75 6e 63 | 74 69 6f 6e 20 41 72 63 | func|tion Arc|
|00001d40| 73 69 6e 28 58 20 3a 20 | 52 65 61 6c 29 20 72 65 |sin(X : |Real) re|
|00001d50| 74 75 72 6e 20 52 65 61 | 6c 20 72 65 6e 61 6d 65 |turn Rea|l rename|
|00001d60| 73 20 4d 61 74 68 2e 41 | 73 69 6e 0d 0a 20 20 20 |s Math.A|sin.. |
|00001d70| 20 20 20 20 66 75 6e 63 | 74 69 6f 6e 20 20 20 4c | func|tion L|
|00001d80| 6f 67 20 28 58 20 3a 20 | 52 65 61 6c 29 20 72 65 |og (X : |Real) re|
|00001d90| 74 75 72 6e 20 52 65 61 | 6c 20 72 65 6e 61 6d 65 |turn Rea|l rename|
|00001da0| 73 20 4d 61 74 68 2e 20 | 20 4c 6e 3b 0d 0a 0d 0a |s Math. | Ln;....|
|00001db0| 20 20 20 20 20 20 20 2d | 2d 20 20 45 76 65 72 79 | -|- Every|
|00001dc0| 74 68 69 6e 67 20 62 65 | 79 6f 6e 64 20 74 68 69 |thing be|yond thi|
|00001dd0| 73 20 70 6f 69 6e 74 20 | 69 73 20 61 62 73 74 72 |s point |is abstr|
|00001de0| 61 63 74 20 77 69 74 68 | 20 72 65 73 70 65 63 74 |act with| respect|
|00001df0| 20 74 6f 0d 0a 20 20 20 | 20 20 20 20 2d 2d 20 20 | to.. | -- |
|00001e00| 74 68 65 20 6e 61 6d 65 | 73 20 6f 66 20 74 68 65 |the name|s of the|
|00001e10| 20 66 6c 6f 61 74 69 6e | 67 20 70 6f 69 6e 74 20 | floatin|g point |
|00001e20| 28 52 65 61 6c 29 2c 20 | 74 68 65 20 66 75 6e 63 |(Real), |the func|
|00001e30| 74 69 6f 6e 73 20 28 41 | 72 63 73 69 6e 0d 0a 20 |tions (A|rcsin.. |
|00001e40| 20 20 20 20 20 20 2d 2d | 20 20 61 6e 64 20 4c 6f | --| and Lo|
|00001e50| 67 29 2c 20 61 6e 64 20 | 74 68 65 20 70 61 63 6b |g), and |the pack|
|00001e60| 61 67 65 20 74 68 61 74 | 20 65 78 70 6f 72 74 65 |age that| exporte|
|00001e70| 64 20 74 68 65 6d 20 28 | 4d 61 74 68 29 2e 0d 0a |d them (|Math)...|
|00001e80| 20 20 20 20 20 20 20 2e | 2e 2e 0d 0a 20 20 20 20 | .|.... |
|00001e90| 20 65 6e 64 20 45 78 61 | 6d 70 6c 65 5f 32 3b 0d | end Exa|mple_2;.|
|00001ea0| 0a 0d 0a 0d 0a 20 20 20 | 49 20 70 72 65 66 65 72 |..... |I prefer|
|00001eb0| 20 74 6f 20 6d 61 6b 65 | 20 65 76 65 72 79 20 70 | to make| every p|
|00001ec0| 61 63 6b 61 67 65 20 61 | 6e 64 20 73 75 62 70 72 |ackage a|nd subpr|
|00001ed0| 6f 67 72 61 6d 20 28 65 | 76 65 6e 20 74 65 73 74 |ogram (e|ven test|
|00001ee0| 20 70 72 6f 63 65 64 75 | 72 65 73 29 0d 0a 20 20 | procedu|res).. |
|00001ef0| 20 61 73 20 63 6f 6d 70 | 69 6c 65 72 20 69 6e 64 | as comp|iler ind|
|00001f00| 65 70 65 6e 64 65 6e 74 | 20 61 6e 64 20 6d 61 63 |ependent| and mac|
|00001f10| 68 69 6e 65 20 70 6f 72 | 74 61 62 6c 65 20 61 73 |hine por|table as|
|00001f20| 20 70 6f 73 73 69 62 6c | 65 2e 20 54 6f 20 64 6f | possibl|e. To do|
|00001f30| 20 74 68 69 73 0d 0a 20 | 20 20 79 6f 75 20 6d 6f | this.. | you mo|
|00001f40| 76 65 20 61 6c 6c 20 6f | 66 20 74 68 65 20 72 65 |ve all o|f the re|
|00001f50| 6e 61 6d 69 6e 67 20 6f | 66 20 63 6f 6d 70 69 6c |naming o|f compil|
|00001f60| 65 72 20 64 65 70 65 6e | 64 65 6e 74 20 66 75 6e |er depen|dent fun|
|00001f70| 63 74 69 6f 6e 73 20 61 | 6e 64 20 61 6c 6c 0d 0a |ctions a|nd all..|
|00001f80| 20 20 20 6f 66 20 74 68 | 65 20 22 77 69 74 68 69 | of th|e "withi|
|00001f90| 6e 67 22 20 6f 66 20 63 | 6f 6d 70 69 6c 65 72 20 |ng" of c|ompiler |
|00001fa0| 64 65 70 65 6e 64 65 6e | 74 20 70 61 63 6b 61 67 |dependen|t packag|
|00001fb0| 65 73 20 74 6f 20 61 20 | 73 69 6e 67 6c 65 20 70 |es to a |single p|
|00001fc0| 61 63 6b 61 67 65 2e 0d | 0a 20 20 20 49 6e 20 74 |ackage..|. In t|
|00001fd0| 68 65 20 65 78 61 6d 70 | 6c 65 20 74 68 61 74 20 |he examp|le that |
|00001fe0| 66 6f 6c 6c 6f 77 73 2c | 20 69 74 73 20 63 61 6c |follows,| its cal|
|00001ff0| 6c 65 64 20 4d 61 74 68 | 5f 4c 69 62 5f 38 2e 20 |led Math|_Lib_8. |
|00002000| 4d 61 74 68 5f 4c 69 62 | 5f 38 20 72 65 6e 61 6d |Math_Lib|_8 renam|
|00002010| 65 73 0d 0a 20 20 20 74 | 68 65 20 38 2d 62 79 74 |es.. t|he 8-byt|
|00002020| 65 20 66 6c 6f 61 74 69 | 6e 67 20 70 6f 69 6e 74 |e floati|ng point|
|00002030| 20 74 79 70 65 20 74 6f | 20 52 65 61 6c 5f 38 2c | type to| Real_8,|
|00002040| 20 61 6e 64 20 6d 61 6b | 65 73 20 73 75 72 65 20 | and mak|es sure |
|00002050| 74 68 65 20 6d 61 74 68 | 0d 0a 20 20 20 66 75 6e |the math|.. fun|
|00002060| 63 74 69 6f 6e 73 20 66 | 6f 6c 6c 6f 77 20 74 68 |ctions f|ollow th|
|00002070| 65 20 41 64 61 20 39 35 | 20 73 74 61 6e 64 61 72 |e Ada 95| standar|
|00002080| 64 2c 20 61 74 20 6c 65 | 61 73 74 20 69 6e 20 6e |d, at le|ast in n|
|00002090| 61 6d 65 2e 20 49 6e 20 | 74 68 69 73 0d 0a 20 20 |ame. In |this.. |
|000020a0| 20 61 70 70 72 6f 61 63 | 68 20 4d 61 74 68 5f 4c | approac|h Math_L|
|000020b0| 69 62 5f 38 20 69 73 20 | 74 68 65 20 6f 6e 6c 79 |ib_8 is |the only|
|000020c0| 20 63 6f 6d 70 69 6c 65 | 72 20 64 65 70 65 6e 64 | compile|r depend|
|000020d0| 65 6e 74 20 63 6f 6d 70 | 6f 6e 65 6e 74 2e 0d 0a |ent comp|onent...|
|000020e0| 0d 0a 20 20 20 54 68 65 | 72 65 20 61 72 65 20 6f |.. The|re are o|
|000020f0| 74 68 65 72 2c 20 70 65 | 72 68 61 70 73 20 62 65 |ther, pe|rhaps be|
|00002100| 74 74 65 72 2c 20 77 61 | 79 73 20 61 6c 73 6f 2e |tter, wa|ys also.|
|00002110| 20 53 65 65 20 66 6f 72 | 20 65 78 61 6d 70 6c 65 | See for| example|
|00002120| 2c 20 22 41 64 61 20 49 | 6e 0d 0a 20 20 20 41 63 |, "Ada I|n.. Ac|
|00002130| 74 69 6f 6e 22 2c 20 62 | 79 20 44 6f 2d 57 68 69 |tion", b|y Do-Whi|
|00002140| 6c 65 20 4a 6f 6e 65 73 | 20 66 6f 72 20 61 20 67 |le Jones| for a g|
|00002150| 65 6e 65 72 69 63 20 73 | 6f 6c 75 74 69 6f 6e 2e |eneric s|olution.|
|00002160| 0d 0a 0d 0a 20 20 20 48 | 65 72 65 27 73 20 74 68 |.... H|ere's th|
|00002170| 65 20 73 70 65 63 20 6f | 66 20 4d 61 74 68 5f 4c |e spec o|f Math_L|
|00002180| 69 62 5f 38 2c 20 77 68 | 69 63 68 20 69 73 20 61 |ib_8, wh|ich is a|
|00002190| 20 70 65 72 66 65 63 74 | 20 73 75 62 73 65 74 20 | perfect| subset |
|000021a0| 6f 66 20 70 61 63 6b 61 | 67 65 0d 0a 20 20 20 4d |of packa|ge.. M|
|000021b0| 61 74 68 5f 45 6e 76 5f | 38 2c 20 61 76 61 69 6c |ath_Env_|8, avail|
|000021c0| 61 62 6c 65 20 62 79 20 | 46 54 50 20 69 6e 20 66 |able by |FTP in f|
|000021d0| 69 6c 65 0d 0a 20 20 20 | 66 74 70 3a 2f 2f 6c 67 |ile.. |ftp://lg|
|000021e0| 6c 66 74 70 2e 65 70 66 | 6c 2e 63 68 2f 70 75 62 |lftp.epf|l.ch/pub|
|000021f0| 2f 41 64 61 2f 46 41 51 | 2f 6d 61 74 68 5f 65 6e |/Ada/FAQ|/math_en|
|00002200| 76 5f 38 2e 61 64 61 0d | 0a 0d 0a 0d 0a 2d 2d 2a |v_8.ada.|.....--*|
|00002210| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002220| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002230| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002240| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 0d 0a |********|******..|
|00002250| 2d 2d 20 50 61 63 6b 61 | 67 65 20 4d 61 74 68 5f |-- Packa|ge Math_|
|00002260| 4c 69 62 5f 38 0d 0a 2d | 2d 0d 0a 2d 2d 20 41 20 |Lib_8..-|-..-- A |
|00002270| 6d 69 6e 69 6d 61 6c 20 | 6d 61 74 68 20 70 61 63 |minimal |math pac|
|00002280| 6b 61 67 65 20 66 6f 72 | 20 41 64 61 20 38 33 3a |kage for| Ada 83:|
|00002290| 20 63 72 65 61 74 65 73 | 20 61 20 73 74 61 6e 64 | creates| a stand|
|000022a0| 61 72 64 20 69 6e 74 65 | 72 66 61 63 65 20 74 6f |ard inte|rface to|
|000022b0| 20 76 65 6e 64 6f 72 0d | 0a 2d 2d 20 73 70 65 63 | vendor.|.-- spec|
|000022c0| 69 66 69 63 20 64 6f 75 | 62 6c 65 2d 70 72 65 63 |ific dou|ble-prec|
|000022d0| 69 73 69 6f 6e 20 28 38 | 2d 62 79 74 65 29 20 6d |ision (8|-byte) m|
|000022e0| 61 74 68 20 6c 69 62 72 | 61 72 69 65 73 2e 20 20 |ath libr|aries. |
|000022f0| 49 74 20 72 65 6e 61 6d | 65 73 20 74 68 65 20 38 |It renam|es the 8|
|00002300| 20 62 79 74 65 0d 0a 2d | 2d 20 46 6c 6f 61 74 69 | byte..-|- Floati|
|00002310| 6e 67 20 70 6f 69 6e 74 | 20 74 79 70 65 20 74 6f |ng point| type to|
|00002320| 20 52 65 61 6c 5f 38 2c | 20 61 6e 64 20 75 73 65 | Real_8,| and use|
|00002330| 73 20 72 65 6e 61 6d 69 | 6e 67 20 74 6f 20 63 72 |s renami|ng to cr|
|00002340| 65 61 74 65 0d 0a 2d 2d | 20 28 41 64 61 20 39 35 |eate..--| (Ada 95|
|00002350| 29 20 73 74 61 6e 64 61 | 72 64 20 6e 61 6d 65 73 |) standa|rd names|
|00002360| 20 66 6f 72 20 53 69 6e | 2c 20 43 6f 73 2c 20 4c | for Sin|, Cos, L|
|00002370| 6f 67 2c 20 53 71 72 74 | 2c 20 41 72 63 73 69 6e |og, Sqrt|, Arcsin|
|00002380| 2c 20 45 78 70 2c 0d 0a | 2d 2d 20 61 6e 64 20 52 |, Exp,..|-- and R|
|00002390| 65 61 6c 5f 38 5f 46 6c | 6f 6f 72 2c 20 61 6c 6c |eal_8_Fl|oor, all|
|000023a0| 20 64 65 66 69 6e 65 64 | 20 66 6f 72 20 52 65 61 | defined| for Rea|
|000023b0| 6c 5f 38 2e 0d 0a 2d 2d | 0d 0a 2d 2d 20 41 20 6d |l_8...--|..-- A m|
|000023c0| 6f 72 65 20 61 6d 62 69 | 74 69 6f 75 73 20 62 75 |ore ambi|tious bu|
|000023d0| 74 20 70 65 72 68 61 70 | 73 20 6c 65 73 73 20 65 |t perhap|s less e|
|000023e0| 66 66 69 63 69 65 6e 74 | 0d 0a 2d 2d 20 70 61 63 |fficient|..-- pac|
|000023f0| 6b 61 67 65 20 77 6f 75 | 6c 64 20 77 72 61 70 20 |kage wou|ld wrap |
|00002400| 74 68 65 20 63 6f 6d 70 | 69 6c 65 72 20 73 70 65 |the comp|iler spe|
|00002410| 63 69 66 69 63 20 66 75 | 6e 63 74 69 6f 6e 73 20 |cific fu|nctions |
|00002420| 69 6e 20 66 75 6e 63 74 | 69 6f 6e 20 63 61 6c 6c |in funct|ion call|
|00002430| 73 2c 20 61 6e 64 0d 0a | 2d 2d 20 64 6f 20 65 72 |s, and..|-- do er|
|00002440| 72 6f 72 20 68 61 6e 64 | 6c 69 6e 67 20 6f 6e 20 |ror hand|ling on |
|00002450| 74 68 65 20 61 72 67 75 | 6d 65 6e 74 73 20 74 6f |the argu|ments to|
|00002460| 20 41 64 61 20 39 35 20 | 73 74 61 6e 64 61 72 64 | Ada 95 |standard|
|00002470| 73 2e 0d 0a 2d 2d 0d 0a | 2d 2d 20 54 68 65 20 70 |s...--..|-- The p|
|00002480| 61 63 6b 61 67 65 20 61 | 73 73 75 6d 65 73 20 74 |ackage a|ssumes t|
|00002490| 68 61 74 20 52 65 61 6c | 5f 38 27 44 69 67 69 74 |hat Real|_8'Digit|
|000024a0| 73 20 3e 20 31 33 2c 20 | 61 6e 64 20 74 68 61 74 |s > 13, |and that|
|000024b0| 0d 0a 2d 2d 20 52 65 61 | 6c 5f 38 27 4d 61 63 68 |..-- Rea|l_8'Mach|
|000024c0| 69 6e 65 5f 4d 61 6e 74 | 69 73 73 61 20 3c 20 36 |ine_Mant|issa < 6|
|000024d0| 31 2e 20 20 54 68 65 73 | 65 20 61 72 65 20 61 73 |1. Thes|e are as|
|000024e0| 73 65 72 74 65 64 20 61 | 66 74 65 72 20 74 68 65 |serted a|fter the|
|000024f0| 0d 0a 2d 2d 20 62 65 67 | 69 6e 20 73 74 61 74 65 |..-- beg|in state|
|00002500| 6d 65 6e 74 20 69 6e 20 | 74 68 65 20 62 6f 64 79 |ment in |the body|
|00002510| 2e 0d 0a 2d 2d 0d 0a 2d | 2d 20 53 6f 6d 65 20 41 |...--..-|- Some A|
|00002520| 64 61 20 38 33 20 63 6f | 6d 70 69 6c 65 72 73 20 |da 83 co|mpilers |
|00002530| 64 6f 6e 27 74 20 70 72 | 6f 76 69 64 65 20 41 72 |don't pr|ovide Ar|
|00002540| 63 73 69 6e 2c 20 73 6f | 20 61 20 72 61 74 69 6f |csin, so| a ratio|
|00002550| 6e 61 6c 2d 70 6f 6c 79 | 6e 6f 6d 69 61 6c 2b 0d |nal-poly|nomial+.|
|00002560| 0a 2d 2d 20 4e 65 77 74 | 6f 6e 2d 52 61 70 68 73 |.-- Newt|on-Raphs|
|00002570| 6f 6e 20 6d 65 74 68 6f | 64 20 41 72 63 73 69 6e |on metho|d Arcsin|
|00002580| 20 61 6e 64 20 41 72 63 | 63 6f 73 20 70 61 69 72 | and Arc|cos pair|
|00002590| 20 61 72 65 20 70 72 6f | 76 69 64 65 64 20 69 6e | are pro|vided in|
|000025a0| 20 74 68 65 20 62 6f 64 | 79 2e 0d 0a 2d 2d 0d 0a | the bod|y...--..|
|000025b0| 2d 2d 20 53 6f 6d 65 20 | 41 64 61 20 38 33 20 63 |-- Some |Ada 83 c|
|000025c0| 6f 6d 70 69 6c 65 72 73 | 20 64 6f 6e 27 74 20 70 |ompilers| don't p|
|000025d0| 72 6f 76 69 64 65 20 66 | 6f 72 20 74 72 75 6e 63 |rovide f|or trunc|
|000025e0| 61 74 69 6f 6e 20 6f 66 | 20 38 20 62 79 74 65 20 |ation of| 8 byte |
|000025f0| 66 6c 6f 61 74 73 2e 0d | 0a 2d 2d 20 54 72 75 6e |floats..|.-- Trun|
|00002600| 63 61 74 69 6f 6e 20 69 | 73 20 70 72 6f 76 69 64 |cation i|s provid|
|00002610| 65 64 20 68 65 72 65 20 | 69 6e 20 73 6f 66 74 77 |ed here |in softw|
|00002620| 61 72 65 20 66 6f 72 20 | 43 6f 6d 70 69 6c 65 72 |are for |Compiler|
|00002630| 73 20 74 68 61 74 20 64 | 6f 6e 27 74 20 68 61 76 |s that d|on't hav|
|00002640| 65 20 69 74 2e 0d 0a 2d | 2d 20 54 68 65 20 41 64 |e it...-|- The Ad|
|00002650| 61 20 39 35 20 66 75 6e | 63 74 69 6f 6e 20 66 6f |a 95 fun|ction fo|
|00002660| 72 20 74 72 75 6e 63 61 | 74 69 6e 67 20 28 74 6f |r trunca|ting (to|
|00002670| 77 61 72 64 20 6e 65 67 | 20 69 6e 66 69 6e 69 74 |ward neg| infinit|
|00002680| 79 29 20 69 73 20 63 61 | 6c 6c 65 64 20 27 46 6c |y) is ca|lled 'Fl|
|00002690| 6f 6f 72 2e 0d 0a 2d 2d | 0d 0a 2d 2d 20 54 68 65 |oor...--|..-- The|
|000026a0| 20 6e 61 6d 65 73 20 6f | 66 20 74 68 65 20 66 75 | names o|f the fu|
|000026b0| 6e 63 74 69 6f 6e 73 20 | 65 78 70 6f 72 74 65 64 |nctions |exported|
|000026c0| 20 62 65 6c 6f 77 20 61 | 67 72 65 65 20 77 69 74 | below a|gree wit|
|000026d0| 68 20 74 68 65 20 41 64 | 61 39 58 20 73 74 61 6e |h the Ad|a9X stan|
|000026e0| 64 61 72 64 2c 0d 0a 2d | 2d 20 62 75 74 20 6e 6f |dard,..-|- but no|
|000026f0| 74 2c 20 69 6e 20 61 6c | 6c 20 6c 69 6b 65 6c 69 |t, in al|l likeli|
|00002700| 68 6f 6f 64 20 74 68 65 | 20 73 65 6d 61 6e 74 69 |hood the| semanti|
|00002710| 63 73 2e 20 20 20 49 74 | 20 69 73 20 75 70 20 74 |cs. It| is up t|
|00002720| 6f 20 74 68 65 20 75 73 | 65 72 20 74 6f 0d 0a 2d |o the us|er to..-|
|00002730| 2d 20 62 65 20 63 61 72 | 65 66 75 6c 2e 2e 2e 74 |- be car|eful...t|
|00002740| 6f 20 64 6f 20 68 69 73 | 20 6f 77 6e 20 65 72 72 |o do his| own err|
|00002750| 6f 72 20 68 61 6e 64 6c | 69 6e 67 20 6f 6e 20 74 |or handl|ing on t|
|00002760| 68 65 20 61 72 67 75 6d | 65 6e 74 73 2c 20 65 74 |he argum|ents, et|
|00002770| 63 2e 0d 0a 2d 2d 20 54 | 68 65 20 70 65 72 66 6f |c...-- T|he perfo|
|00002780| 72 6d 61 6e 63 65 20 6f | 66 20 74 68 65 73 65 20 |rmance o|f these |
|00002790| 66 75 6e 63 74 69 6f 6e | 20 63 61 6e 20 62 65 20 |function| can be |
|000027a0| 6e 6f 6e 2d 70 6f 72 74 | 61 62 6c 65 2c 0d 0a 2d |non-port|able,..-|
|000027b0| 2d 20 62 75 74 20 69 6e | 20 70 72 61 63 74 69 63 |- but in| practic|
|000027c0| 65 20 74 68 65 79 20 68 | 61 76 65 20 74 68 65 69 |e they h|ave thei|
|000027d0| 72 20 75 73 75 61 6c 20 | 6d 65 61 6e 69 6e 67 73 |r usual |meanings|
|000027e0| 20 75 6e 6c 65 73 73 20 | 79 6f 75 20 63 68 6f 6f | unless |you choo|
|000027f0| 73 65 0d 0a 2d 2d 20 77 | 65 69 72 64 20 61 72 67 |se..-- w|eird arg|
|00002800| 75 6d 65 6e 74 73 2e 20 | 20 54 68 65 20 69 73 73 |uments. | The iss|
|00002810| 75 65 73 20 61 72 65 20 | 74 68 65 20 73 61 6d 65 |ues are |the same|
|00002820| 20 77 69 74 68 20 6d 6f | 73 74 20 6d 61 74 68 20 | with mo|st math |
|00002830| 6c 69 62 72 61 72 69 65 | 73 2e 0d 0a 2d 2d 2a 2a |librarie|s...--**|
|00002840| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002850| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002860| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002870| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 0d 0a 0d |********|*****...|
|00002880| 0a 2d 2d 77 69 74 68 20 | 4d 61 74 68 5f 4c 69 62 |.--with |Math_Lib|
|00002890| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|000028a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000028b0| 20 20 20 2d 2d 20 4d 65 | 72 69 64 69 61 6e 20 44 | -- Me|ridian D|
|000028c0| 4f 53 20 41 64 61 2e 0d | 0a 20 20 77 69 74 68 20 |OS Ada..|. with |
|000028d0| 4c 6f 6e 67 5f 46 6c 6f | 61 74 5f 4d 61 74 68 5f |Long_Flo|at_Math_|
|000028e0| 4c 69 62 3b 20 20 20 20 | 20 20 20 20 20 20 20 20 |Lib; | |
|000028f0| 20 20 20 20 20 20 20 20 | 20 20 20 2d 2d 20 44 65 | | -- De|
|00002900| 63 20 56 4d 53 0d 0a 2d | 2d 77 69 74 68 20 41 64 |c VMS..-|-with Ad|
|00002910| 61 2e 4e 75 6d 65 72 69 | 63 73 2e 47 65 6e 65 72 |a.Numeri|cs.Gener|
|00002920| 69 63 5f 45 6c 65 6d 65 | 6e 74 61 72 79 5f 46 75 |ic_Eleme|ntary_Fu|
|00002930| 6e 63 74 69 6f 6e 73 3b | 20 2d 2d 20 41 64 61 39 |nctions;| -- Ada9|
|00002940| 58 0d 0a 70 61 63 6b 61 | 67 65 20 4d 61 74 68 5f |X..packa|ge Math_|
|00002950| 4c 69 62 5f 38 20 69 73 | 0d 0a 0d 0a 2d 2d 73 75 |Lib_8 is|....--su|
|00002960| 62 74 79 70 65 20 52 65 | 61 6c 5f 38 20 69 73 20 |btype Re|al_8 is |
|00002970| 46 6c 6f 61 74 3b 20 20 | 20 20 20 20 20 20 20 20 |Float; | |
|00002980| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2d 2d | | --|
|00002990| 20 4d 65 72 69 64 69 61 | 6e 20 38 2d 62 79 74 65 | Meridia|n 8-byte|
|000029a0| 20 52 65 61 6c 0d 0a 20 | 20 73 75 62 74 79 70 65 | Real.. | subtype|
|000029b0| 20 52 65 61 6c 5f 38 20 | 69 73 20 4c 6f 6e 67 5f | Real_8 |is Long_|
|000029c0| 46 6c 6f 61 74 3b 20 20 | 20 20 20 20 20 20 20 20 |Float; | |
|000029d0| 20 20 20 20 20 20 20 20 | 20 2d 2d 20 44 65 63 20 | | -- Dec |
|000029e0| 56 4d 53 20 20 38 2d 62 | 79 74 65 20 52 65 61 6c |VMS 8-b|yte Real|
|000029f0| 0d 0a 0d 0a 20 2d 2d 70 | 61 63 6b 61 67 65 20 4d |.... --p|ackage M|
|00002a00| 61 74 68 20 72 65 6e 61 | 6d 65 73 20 4d 61 74 68 |ath rena|mes Math|
|00002a10| 5f 4c 69 62 3b 20 20 20 | 20 20 20 20 20 20 20 20 |_Lib; | |
|00002a20| 20 20 20 20 20 20 2d 2d | 20 4d 65 72 69 64 69 61 | --| Meridia|
|00002a30| 6e 20 44 4f 53 20 41 64 | 61 0d 0a 20 20 20 70 61 |n DOS Ad|a.. pa|
|00002a40| 63 6b 61 67 65 20 4d 61 | 74 68 20 72 65 6e 61 6d |ckage Ma|th renam|
|00002a50| 65 73 20 4c 6f 6e 67 5f | 46 6c 6f 61 74 5f 4d 61 |es Long_|Float_Ma|
|00002a60| 74 68 5f 4c 69 62 3b 20 | 20 20 20 20 20 2d 2d 20 |th_Lib; | -- |
|00002a70| 44 65 63 20 56 4d 53 0d | 0a 20 2d 2d 70 61 63 6b |Dec VMS.|. --pack|
|00002a80| 61 67 65 20 4d 61 74 68 | 20 69 73 20 6e 65 77 20 |age Math| is new |
|00002a90| 41 64 61 2e 4e 75 6d 65 | 72 69 63 73 2e 47 65 6e |Ada.Nume|rics.Gen|
|00002aa0| 65 72 69 63 5f 45 6c 65 | 6d 65 6e 74 61 72 79 5f |eric_Ele|mentary_|
|00002ab0| 46 75 6e 63 74 69 6f 6e | 73 28 52 65 61 6c 5f 38 |Function|s(Real_8|
|00002ac0| 29 3b 0d 0a 0d 0a 20 20 | 20 2d 2d 20 20 54 68 65 |);.... | -- The|
|00002ad0| 20 61 62 6f 76 65 20 69 | 6e 73 74 61 6e 74 69 61 | above i|nstantia|
|00002ae0| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 41 64 61 2e |tion of |the Ada.|
|00002af0| 4e 75 6d 65 72 69 63 73 | 20 63 68 69 6c 64 20 70 |Numerics| child p|
|00002b00| 61 63 6b 61 67 65 20 77 | 6f 72 6b 73 20 6f 6e 0d |ackage w|orks on.|
|00002b10| 0a 20 20 20 2d 2d 20 20 | 47 4e 41 54 2c 20 6f 72 |. -- |GNAT, or|
|00002b20| 20 61 6e 79 20 6f 74 68 | 65 72 20 41 64 61 20 39 | any oth|er Ada 9|
|00002b30| 35 20 63 6f 6d 70 69 6c | 65 72 2e 20 20 49 74 73 |5 compil|er. Its|
|00002b40| 20 68 65 72 65 20 69 66 | 20 79 6f 75 20 77 61 6e | here if| you wan|
|00002b50| 74 20 74 6f 20 75 73 65 | 0d 0a 20 20 20 2d 2d 20 |t to use|.. -- |
|00002b60| 20 61 6e 20 41 64 61 20 | 39 35 20 63 6f 6d 70 69 | an Ada |95 compi|
|00002b70| 6c 65 72 20 74 6f 20 63 | 6f 6d 70 69 6c 65 20 41 |ler to c|ompile A|
|00002b80| 64 61 20 38 33 20 70 72 | 6f 67 72 61 6d 73 20 62 |da 83 pr|ograms b|
|00002b90| 61 73 65 64 20 6f 6e 20 | 74 68 69 73 20 70 61 63 |ased on |this pac|
|00002ba0| 6b 61 67 65 2e 0d 0a 0d | 0a 20 20 20 66 75 6e 63 |kage....|. func|
|00002bb0| 74 69 6f 6e 20 43 6f 73 | 20 28 58 20 3a 20 52 65 |tion Cos| (X : Re|
|00002bc0| 61 6c 5f 38 29 20 72 65 | 74 75 72 6e 20 52 65 61 |al_8) re|turn Rea|
|00002bd0| 6c 5f 38 20 72 65 6e 61 | 6d 65 73 20 4d 61 74 68 |l_8 rena|mes Math|
|00002be0| 2e 43 6f 73 3b 0d 0a 20 | 20 20 66 75 6e 63 74 69 |.Cos;.. | functi|
|00002bf0| 6f 6e 20 53 69 6e 20 28 | 58 20 3a 20 52 65 61 6c |on Sin (|X : Real|
|00002c00| 5f 38 29 20 72 65 74 75 | 72 6e 20 52 65 61 6c 5f |_8) retu|rn Real_|
|00002c10| 38 20 72 65 6e 61 6d 65 | 73 20 4d 61 74 68 2e 53 |8 rename|s Math.S|
|00002c20| 69 6e 3b 0d 0a 20 20 20 | 66 75 6e 63 74 69 6f 6e |in;.. |function|
|00002c30| 20 53 71 72 74 28 58 20 | 3a 20 52 65 61 6c 5f 38 | Sqrt(X |: Real_8|
|00002c40| 29 20 72 65 74 75 72 6e | 20 52 65 61 6c 5f 38 20 |) return| Real_8 |
|00002c50| 72 65 6e 61 6d 65 73 20 | 4d 61 74 68 2e 53 71 72 |renames |Math.Sqr|
|00002c60| 74 3b 0d 0a 20 20 20 66 | 75 6e 63 74 69 6f 6e 20 |t;.. f|unction |
|00002c70| 45 78 70 20 28 58 20 3a | 20 52 65 61 6c 5f 38 29 |Exp (X :| Real_8)|
|00002c80| 20 72 65 74 75 72 6e 20 | 52 65 61 6c 5f 38 20 72 | return |Real_8 r|
|00002c90| 65 6e 61 6d 65 73 20 4d | 61 74 68 2e 45 78 70 3b |enames M|ath.Exp;|
|00002ca0| 0d 0a 0d 0a 20 2d 2d 66 | 75 6e 63 74 69 6f 6e 20 |.... --f|unction |
|00002cb0| 4c 6f 67 20 28 58 20 3a | 20 52 65 61 6c 5f 38 29 |Log (X :| Real_8)|
|00002cc0| 20 72 65 74 75 72 6e 20 | 52 65 61 6c 5f 38 20 72 | return |Real_8 r|
|00002cd0| 65 6e 61 6d 65 73 20 4d | 61 74 68 2e 4c 6e 3b 20 |enames M|ath.Ln; |
|00002ce0| 20 20 20 20 20 20 20 2d | 2d 20 4d 65 72 69 64 69 | -|- Meridi|
|00002cf0| 61 6e 0d 0a 20 20 20 66 | 75 6e 63 74 69 6f 6e 20 |an.. f|unction |
|00002d00| 4c 6f 67 20 28 58 20 3a | 20 52 65 61 6c 5f 38 29 |Log (X :| Real_8)|
|00002d10| 20 72 65 74 75 72 6e 20 | 52 65 61 6c 5f 38 20 72 | return |Real_8 r|
|00002d20| 65 6e 61 6d 65 73 20 4d | 61 74 68 2e 4c 6f 67 3b |enames M|ath.Log;|
|00002d30| 20 20 20 20 20 20 20 2d | 2d 20 44 65 63 20 56 4d | -|- Dec VM|
|00002d40| 53 0d 0a 20 2d 2d 66 75 | 6e 63 74 69 6f 6e 20 4c |S.. --fu|nction L|
|00002d50| 6f 67 20 28 58 20 3a 20 | 52 65 61 6c 5f 38 29 20 |og (X : |Real_8) |
|00002d60| 72 65 74 75 72 6e 20 52 | 65 61 6c 5f 38 20 72 65 |return R|eal_8 re|
|00002d70| 6e 61 6d 65 73 20 4d 61 | 74 68 2e 4c 6f 67 3b 20 |names Ma|th.Log; |
|00002d80| 20 20 20 20 20 20 2d 2d | 20 41 64 61 20 39 35 0d | --| Ada 95.|
|00002d90| 0a 0d 0a 20 2d 2d 66 75 | 6e 63 74 69 6f 6e 20 41 |... --fu|nction A|
|00002da0| 72 63 73 69 6e 20 28 58 | 20 3a 20 52 65 61 6c 5f |rcsin (X| : Real_|
|00002db0| 38 29 20 72 65 74 75 72 | 6e 20 52 65 61 6c 5f 38 |8) retur|n Real_8|
|00002dc0| 20 72 65 6e 61 6d 65 73 | 20 4d 61 74 68 2e 41 73 | renames| Math.As|
|00002dd0| 69 6e 3b 20 20 20 2d 2d | 20 44 65 63 20 56 4d 53 |in; --| Dec VMS|
|00002de0| 0d 0a 20 2d 2d 66 75 6e | 63 74 69 6f 6e 20 41 72 |.. --fun|ction Ar|
|00002df0| 63 73 69 6e 20 28 58 20 | 3a 20 52 65 61 6c 5f 38 |csin (X |: Real_8|
|00002e00| 29 20 72 65 74 75 72 6e | 20 52 65 61 6c 5f 38 20 |) return| Real_8 |
|00002e10| 72 65 6e 61 6d 65 73 20 | 4d 61 74 68 2e 41 72 63 |renames |Math.Arc|
|00002e20| 73 69 6e 3b 20 2d 2d 20 | 41 64 61 20 39 35 0d 0a |sin; -- |Ada 95..|
|00002e30| 20 20 20 66 75 6e 63 74 | 69 6f 6e 20 41 72 63 73 | funct|ion Arcs|
|00002e40| 69 6e 20 28 58 20 3a 20 | 52 65 61 6c 5f 38 29 20 |in (X : |Real_8) |
|00002e50| 72 65 74 75 72 6e 20 52 | 65 61 6c 5f 38 3b 0d 0a |return R|eal_8;..|
|00002e60| 20 20 20 2d 2d 20 20 49 | 6d 70 6c 65 6d 65 6e 74 | -- I|mplement|
|00002e70| 65 64 20 69 6e 20 74 68 | 65 20 62 6f 64 79 2e 20 |ed in th|e body. |
|00002e80| 20 53 68 6f 75 6c 64 20 | 77 6f 72 6b 20 77 69 74 | Should |work wit|
|00002e90| 68 20 61 6e 79 20 63 6f | 6d 70 69 6c 65 72 2e 0d |h any co|mpiler..|
|00002ea0| 0a 0d 0a 20 2d 2d 66 75 | 6e 63 74 69 6f 6e 20 41 |... --fu|nction A|
|00002eb0| 72 63 63 6f 73 20 28 58 | 20 3a 20 52 65 61 6c 5f |rccos (X| : Real_|
|00002ec0| 38 29 20 72 65 74 75 72 | 6e 20 52 65 61 6c 5f 38 |8) retur|n Real_8|
|00002ed0| 20 72 65 6e 61 6d 65 73 | 20 4d 61 74 68 2e 41 63 | renames| Math.Ac|
|00002ee0| 6f 73 3b 20 20 20 2d 2d | 20 44 65 63 20 56 4d 53 |os; --| Dec VMS|
|00002ef0| 0d 0a 20 2d 2d 66 75 6e | 63 74 69 6f 6e 20 41 72 |.. --fun|ction Ar|
|00002f00| 63 63 6f 73 20 28 58 20 | 3a 20 52 65 61 6c 5f 38 |ccos (X |: Real_8|
|00002f10| 29 20 72 65 74 75 72 6e | 20 52 65 61 6c 5f 38 20 |) return| Real_8 |
|00002f20| 72 65 6e 61 6d 65 73 20 | 4d 61 74 68 2e 41 72 63 |renames |Math.Arc|
|00002f30| 63 6f 73 3b 20 2d 2d 20 | 41 64 61 20 39 35 0d 0a |cos; -- |Ada 95..|
|00002f40| 20 20 20 66 75 6e 63 74 | 69 6f 6e 20 41 72 63 63 | funct|ion Arcc|
|00002f50| 6f 73 20 28 58 20 3a 20 | 52 65 61 6c 5f 38 29 20 |os (X : |Real_8) |
|00002f60| 72 65 74 75 72 6e 20 52 | 65 61 6c 5f 38 3b 0d 0a |return R|eal_8;..|
|00002f70| 20 20 20 2d 2d 20 20 49 | 6d 70 6c 65 6d 65 6e 74 | -- I|mplement|
|00002f80| 65 64 20 69 6e 20 74 68 | 65 20 62 6f 64 79 2e 20 |ed in th|e body. |
|00002f90| 20 53 68 6f 75 6c 64 20 | 77 6f 72 6b 20 77 69 74 | Should |work wit|
|00002fa0| 68 20 61 6e 79 20 63 6f | 6d 70 69 6c 65 72 2e 0d |h any co|mpiler..|
|00002fb0| 0a 0d 0a 20 2d 2d 66 75 | 6e 63 74 69 6f 6e 20 52 |... --fu|nction R|
|00002fc0| 65 61 6c 5f 38 5f 46 6c | 6f 6f 72 20 28 58 20 3a |eal_8_Fl|oor (X :|
|00002fd0| 20 52 65 61 6c 5f 38 29 | 20 72 65 74 75 72 6e 20 | Real_8)| return |
|00002fe0| 52 65 61 6c 5f 38 20 72 | 65 6e 61 6d 65 73 20 52 |Real_8 r|enames R|
|00002ff0| 65 61 6c 5f 38 27 46 6c | 6f 6f 72 3b 2d 2d 20 39 |eal_8'Fl|oor;-- 9|
|00003000| 35 0d 0a 20 20 20 66 75 | 6e 63 74 69 6f 6e 20 52 |5.. fu|nction R|
|00003010| 65 61 6c 5f 38 5f 46 6c | 6f 6f 72 20 28 58 20 3a |eal_8_Fl|oor (X :|
|00003020| 20 52 65 61 6c 5f 38 29 | 20 72 65 74 75 72 6e 20 | Real_8)| return |
|00003030| 52 65 61 6c 5f 38 3b 0d | 0a 20 20 20 2d 2d 20 20 |Real_8;.|. -- |
|00003040| 49 6d 70 6c 65 6d 65 6e | 74 65 64 20 69 6e 20 74 |Implemen|ted in t|
|00003050| 68 65 20 62 6f 64 79 2e | 20 20 53 68 6f 75 6c 64 |he body.| Should|
|00003060| 20 77 6f 72 6b 20 77 69 | 74 68 20 61 6e 79 20 63 | work wi|th any c|
|00003070| 6f 6d 70 69 6c 65 72 2e | 0d 0a 0d 0a 65 6e 64 20 |ompiler.|....end |
|00003080| 4d 61 74 68 5f 4c 69 62 | 5f 38 3b 0d 0a 0d 0a 0d |Math_Lib|_8;.....|
|00003090| 0a 36 2e 33 3a 20 49 73 | 20 41 64 61 20 61 6e 79 |.6.3: Is| Ada any|
|000030a0| 20 67 6f 6f 64 20 61 74 | 20 6e 75 6d 65 72 69 63 | good at| numeric|
|000030b0| 73 2c 20 61 6e 64 20 77 | 68 65 72 65 20 63 61 6e |s, and w|here can|
|000030c0| 20 49 20 6c 65 61 72 6e | 20 6d 6f 72 65 20 61 62 | I learn| more ab|
|000030d0| 6f 75 74 20 69 74 3f 0d | 0a 0d 0a 20 20 20 46 69 |out it?.|... Fi|
|000030e0| 72 73 74 20 6f 66 20 61 | 6c 6c 2c 20 61 20 6c 6f |rst of a|ll, a lo|
|000030f0| 74 20 6f 66 20 70 65 6f | 70 6c 65 20 66 69 6e 64 |t of peo|ple find|
|00003100| 20 74 68 65 20 67 65 6e | 65 72 61 6c 20 41 64 61 | the gen|eral Ada|
|00003110| 20 70 68 69 6c 6f 73 6f | 70 68 79 0d 0a 20 20 20 | philoso|phy.. |
|00003120| 28 6d 6f 64 75 6c 61 72 | 69 74 79 2c 20 73 74 72 |(modular|ity, str|
|00003130| 6f 6e 67 2d 74 79 70 69 | 6e 67 2c 20 72 65 61 64 |ong-typi|ng, read|
|00003140| 61 62 6c 65 20 73 79 6e | 74 61 78 2c 20 72 69 67 |able syn|tax, rig|
|00003150| 6f 72 6f 75 73 20 64 65 | 66 69 6e 69 74 69 6f 6e |orous de|finition|
|00003160| 20 61 6e 64 0d 0a 20 20 | 20 73 74 61 6e 64 61 72 | and.. | standar|
|00003170| 64 69 7a 61 74 69 6f 6e | 2c 20 65 74 63 2e 29 20 |dization|, etc.) |
|00003180| 74 6f 20 62 65 20 61 20 | 72 65 61 6c 20 62 65 6e |to be a |real ben|
|00003190| 65 66 69 74 20 69 6e 20 | 6e 75 6d 65 72 69 63 61 |efit in |numerica|
|000031a0| 6c 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 2c 0d 0a |l progra|mming,..|
|000031b0| 20 20 20 61 73 20 77 65 | 6c 6c 20 61 73 20 69 6e | as we|ll as in|
|000031c0| 20 6d 61 6e 79 20 6f 74 | 68 65 72 20 74 79 70 65 | many ot|her type|
|000031d0| 73 20 6f 66 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |s of pro|gramming|
|000031e0| 2e 20 42 75 74 20 41 64 | 61 20 2d 2d 61 6e 64 0d |. But Ad|a --and.|
|000031f0| 0a 20 20 20 65 73 70 65 | 63 69 61 6c 6c 79 20 41 |. espe|cially A|
|00003200| 64 61 20 39 35 2d 2d 20 | 77 61 73 20 61 6c 73 6f |da 95-- |was also|
|00003210| 20 64 65 73 69 67 6e 65 | 64 20 74 6f 20 6d 65 65 | designe|d to mee|
|00003220| 74 20 74 68 65 20 73 70 | 65 63 69 61 6c 20 72 65 |t the sp|ecial re|
|00003230| 71 75 69 72 65 6d 65 6e | 74 73 0d 0a 20 20 20 6f |quiremen|ts.. o|
|00003240| 66 20 6e 75 6d 62 65 72 | 2d 63 72 75 6e 63 68 69 |f number|-crunchi|
|00003250| 6e 67 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 73 2e |ng appli|cations.|
|00003260| 0d 0a 0d 0a 20 20 20 54 | 68 65 20 66 6f 6c 6c 6f |.... T|he follo|
|00003270| 77 69 6e 67 20 73 6b 65 | 74 63 68 65 73 20 6f 75 |wing ske|tches ou|
|00003280| 74 20 73 6f 6d 65 20 6f | 66 20 74 68 65 73 65 20 |t some o|f these |
|00003290| 66 65 61 74 75 72 65 73 | 2e 20 48 6f 70 65 66 75 |features|. Hopefu|
|000032a0| 6c 6c 79 20 61 20 6c 69 | 74 74 6c 65 0d 0a 20 20 |lly a li|ttle.. |
|000032b0| 20 6f 66 20 74 68 65 20 | 66 6c 61 76 6f 72 20 6f | of the |flavor o|
|000032c0| 66 20 74 68 65 20 41 64 | 61 20 70 68 69 6c 6f 73 |f the Ad|a philos|
|000032d0| 6f 70 68 79 20 77 69 6c | 6c 20 67 65 74 20 74 68 |ophy wil|l get th|
|000032e0| 72 6f 75 67 68 2c 20 62 | 75 74 20 74 68 65 20 62 |rough, b|ut the b|
|000032f0| 65 73 74 0d 0a 20 20 20 | 74 68 69 6e 67 20 79 6f |est.. |thing yo|
|00003300| 75 20 63 61 6e 20 64 6f | 20 61 74 20 70 72 65 73 |u can do| at pres|
|00003310| 65 6e 74 20 69 73 20 74 | 6f 20 72 65 61 64 20 74 |ent is t|o read t|
|00003320| 68 65 20 74 77 6f 20 73 | 74 61 6e 64 61 72 64 20 |he two s|tandard |
|00003330| 72 65 66 65 72 65 6e 63 | 65 0d 0a 20 20 20 64 6f |referenc|e.. do|
|00003340| 63 75 6d 65 6e 74 73 2c | 20 74 68 65 20 41 64 61 |cuments,| the Ada|
|00003350| 20 39 35 20 52 61 74 69 | 6f 6e 61 6c 65 20 61 6e | 95 Rati|onale an|
|00003360| 64 20 52 65 66 65 72 65 | 6e 63 65 20 4d 61 6e 75 |d Refere|nce Manu|
|00003370| 61 6c 2e 20 42 65 6c 6f | 77 20 74 68 65 20 47 4e |al. Belo|w the GN|
|00003380| 55 0d 0a 20 20 20 41 64 | 61 20 39 35 20 63 6f 6d |U.. Ad|a 95 com|
|00003390| 70 69 6c 65 72 20 69 73 | 20 72 65 66 65 72 72 65 |piler is| referre|
|000033a0| 64 20 74 6f 20 73 65 76 | 65 72 61 6c 20 74 69 6d |d to sev|eral tim|
|000033b0| 65 73 2e 20 54 68 69 73 | 20 63 6f 6d 70 69 6c 65 |es. This| compile|
|000033c0| 72 20 63 61 6e 20 62 65 | 0d 0a 20 20 20 6f 62 74 |r can be|.. obt|
|000033d0| 61 69 6e 65 64 20 62 79 | 20 61 6e 6f 6e 79 6d 6f |ained by| anonymo|
|000033e0| 75 73 20 46 54 50 20 66 | 72 6f 6d 20 63 73 2e 6e |us FTP f|rom cs.n|
|000033f0| 79 75 2e 65 64 75 2c 20 | 61 6e 64 20 61 74 20 6d |yu.edu, |and at m|
|00003400| 69 72 72 6f 72 20 73 69 | 74 65 73 0d 0a 20 20 20 |irror si|tes.. |
|00003410| 64 65 63 6c 61 72 65 64 | 20 69 6e 20 74 68 65 20 |declared| in the |
|00003420| 52 45 41 44 4d 45 20 66 | 69 6c 65 20 6f 66 20 64 |README f|ile of d|
|00003430| 69 72 65 63 74 6f 72 79 | 20 70 75 62 2f 67 6e 61 |irectory| pub/gna|
|00003440| 74 2e 0d 0a 0d 0a 20 20 | 20 31 2e 20 4d 61 63 68 |t..... | 1. Mach|
|00003450| 69 6e 65 20 70 6f 72 74 | 61 62 6c 65 20 66 6c 6f |ine port|able flo|
|00003460| 61 74 69 6e 67 20 70 6f | 69 6e 74 20 64 65 63 6c |ating po|int decl|
|00003470| 61 72 61 74 69 6f 6e 73 | 2e 20 28 41 64 61 20 38 |arations|. (Ada 8|
|00003480| 33 20 61 6e 64 20 41 64 | 61 20 39 35 29 0d 0a 20 |3 and Ad|a 95).. |
|00003490| 20 20 20 20 20 20 20 20 | 20 49 66 20 79 6f 75 20 | | If you |
|000034a0| 64 65 63 6c 61 72 65 20 | 22 74 79 70 65 20 52 65 |declare |"type Re|
|000034b0| 61 6c 20 69 73 20 64 69 | 67 69 74 73 20 31 34 22 |al is di|gits 14"|
|000034c0| 2c 20 74 68 65 6e 20 74 | 79 70 65 20 52 65 61 6c |, then t|ype Real|
|000034d0| 20 77 69 6c 6c 0d 0a 20 | 20 20 20 20 20 20 20 20 | will.. | |
|000034e0| 20 67 75 61 72 61 6e 74 | 65 65 20 79 6f 75 20 28 | guarant|ee you (|
|000034f0| 61 74 20 6c 65 61 73 74 | 29 20 31 34 20 64 69 67 |at least|) 14 dig|
|00003500| 69 74 73 20 6f 66 20 70 | 72 65 63 69 73 69 6f 6e |its of p|recision|
|00003510| 20 69 6e 64 65 70 65 6e | 64 65 6e 74 6c 79 0d 0a | indepen|dently..|
|00003520| 20 20 20 20 20 20 20 20 | 20 20 6f 66 20 6d 61 63 | | of mac|
|00003530| 68 69 6e 65 20 6f 72 20 | 63 6f 6d 70 69 6c 65 72 |hine or |compiler|
|00003540| 2e 20 49 6e 20 74 68 69 | 73 20 63 61 73 65 20 74 |. In thi|s case t|
|00003550| 68 65 20 62 61 73 65 20 | 74 79 70 65 20 6f 66 20 |he base |type of |
|00003560| 74 79 70 65 20 52 65 61 | 6c 0d 0a 20 20 20 20 20 |type Rea|l.. |
|00003570| 20 20 20 20 20 77 69 6c | 6c 20 75 73 75 61 6c 6c | wil|l usuall|
|00003580| 79 20 62 65 20 74 68 65 | 20 6d 61 63 68 69 6e 65 |y be the| machine|
|00003590| 27 73 20 38 2d 62 79 74 | 65 20 66 6c 6f 61 74 69 |'s 8-byt|e floati|
|000035a0| 6e 67 20 70 6f 69 6e 74 | 20 74 79 70 65 2e 20 49 |ng point| type. I|
|000035b0| 66 20 61 6e 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |f an.. | |
|000035c0| 61 70 70 72 6f 70 72 69 | 61 74 65 20 62 61 73 65 |appropri|ate base|
|000035d0| 20 74 79 70 65 20 69 73 | 20 75 6e 61 76 61 69 6c | type is| unavail|
|000035e0| 61 62 6c 65 20 28 76 65 | 72 79 20 72 61 72 65 29 |able (ve|ry rare)|
|000035f0| 2c 20 74 68 65 6e 20 74 | 68 65 0d 0a 20 20 20 20 |, then t|he.. |
|00003600| 20 20 20 20 20 20 64 65 | 63 6c 61 72 61 74 69 6f | de|claratio|
|00003610| 6e 20 69 73 20 72 65 6a | 65 63 74 65 64 20 62 79 |n is rej|ected by|
|00003620| 20 74 68 65 20 63 6f 6d | 70 69 6c 65 72 2e 0d 0a | the com|piler...|
|00003630| 0d 0a 20 20 20 32 2e 20 | 45 78 74 65 6e 64 65 64 |.. 2. |Extended|
|00003640| 20 70 72 65 63 69 73 69 | 6f 6e 20 66 6f 72 20 69 | precisi|on for i|
|00003650| 6e 69 74 69 61 6c 69 7a | 61 74 69 6f 6e 20 6f 66 |nitializ|ation of|
|00003660| 20 66 6c 6f 61 74 69 6e | 67 20 70 6f 69 6e 74 2e | floatin|g point.|
|00003670| 20 28 41 64 61 20 38 33 | 0d 0a 20 20 20 20 20 20 | (Ada 83|.. |
|00003680| 20 20 20 20 61 6e 64 20 | 41 64 61 20 39 35 29 0d | and |Ada 95).|
|00003690| 0a 20 20 20 20 20 20 20 | 20 20 20 43 6f 6d 70 69 |. | Compi|
|000036a0| 6c 65 72 73 20 61 72 65 | 20 72 65 71 75 69 72 65 |lers are| require|
|000036b0| 64 20 74 6f 20 65 6d 70 | 6c 6f 79 0d 0a 20 20 20 |d to emp|loy.. |
|000036c0| 20 20 20 20 20 20 20 65 | 78 74 65 6e 64 65 64 2d | e|xtended-|
|000036d0| 70 72 65 63 69 73 69 6f | 6e 2f 72 61 74 69 6f 6e |precisio|n/ration|
|000036e0| 61 6c 2d 61 72 69 74 68 | 6d 65 74 69 63 20 72 6f |al-arith|metic ro|
|000036f0| 75 74 69 6e 65 73 20 73 | 6f 20 74 68 61 74 0d 0a |utines s|o that..|
|00003700| 20 20 20 20 20 20 20 20 | 20 20 66 6c 6f 61 74 69 | | floati|
|00003710| 6e 67 20 70 6f 69 6e 74 | 20 76 61 72 69 61 62 6c |ng point| variabl|
|00003720| 65 73 20 61 6e 64 20 63 | 6f 6e 73 74 61 6e 74 73 |es and c|onstants|
|00003730| 20 63 61 6e 20 62 65 20 | 63 6f 72 72 65 63 74 6c | can be |correctl|
|00003740| 79 0d 0a 20 20 20 20 20 | 20 20 20 20 20 69 6e 69 |y.. | ini|
|00003750| 74 69 61 6c 69 7a 65 64 | 20 74 6f 20 74 68 65 69 |tialized| to thei|
|00003760| 72 20 66 75 6c 6c 20 70 | 72 65 63 69 73 69 6f 6e |r full p|recision|
|00003770| 2e 0d 0a 0d 0a 20 20 20 | 33 2e 20 47 65 6e 65 72 |..... |3. Gener|
|00003780| 69 63 20 70 61 63 6b 61 | 67 65 73 20 61 6e 64 20 |ic packa|ges and |
|00003790| 73 75 62 70 72 6f 67 72 | 61 6d 73 2e 20 28 41 64 |subprogr|ams. (Ad|
|000037a0| 61 20 38 33 20 61 6e 64 | 20 41 64 61 20 39 35 29 |a 83 and| Ada 95)|
|000037b0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 41 6c 67 6f |.. | Algo|
|000037c0| 72 69 74 68 6d 73 20 63 | 61 6e 20 62 65 20 77 72 |rithms c|an be wr|
|000037d0| 69 74 74 65 6e 20 73 6f | 20 74 68 61 74 20 74 68 |itten so| that th|
|000037e0| 65 79 20 70 65 72 66 6f | 72 6d 20 6f 6e 20 61 62 |ey perfo|rm on ab|
|000037f0| 73 74 72 61 63 74 0d 0a | 20 20 20 20 20 20 20 20 |stract..| |
|00003800| 20 20 72 65 70 72 65 73 | 65 6e 74 61 74 69 6f 6e | repres|entation|
|00003810| 73 20 6f 66 20 74 68 65 | 20 64 61 74 61 20 73 74 |s of the| data st|
|00003820| 72 75 63 74 75 72 65 2e | 20 53 75 70 70 6f 72 74 |ructure.| Support|
|00003830| 20 66 6f 72 20 74 68 69 | 73 20 69 73 0d 0a 20 20 | for thi|s is.. |
|00003840| 20 20 20 20 20 20 20 20 | 70 72 6f 76 69 64 65 64 | |provided|
|00003850| 20 62 79 20 41 64 61 27 | 73 20 67 65 6e 65 72 69 | by Ada'|s generi|
|00003860| 63 20 66 61 63 69 6c 69 | 74 69 65 73 20 28 77 68 |c facili|ties (wh|
|00003870| 61 74 20 43 2b 2b 20 70 | 72 6f 67 72 61 6d 6d 65 |at C++ p|rogramme|
|00003880| 72 73 0d 0a 20 20 20 20 | 20 20 20 20 20 20 77 6f |rs.. | wo|
|00003890| 75 6c 64 20 63 61 6c 6c | 20 74 65 6d 70 6c 61 74 |uld call| templat|
|000038a0| 65 73 29 2e 0d 0a 0d 0a | 20 20 20 34 2e 20 55 73 |es).....| 4. Us|
|000038b0| 65 72 2d 64 65 66 69 6e | 65 64 20 6f 70 65 72 61 |er-defin|ed opera|
|000038c0| 74 6f 72 73 20 61 6e 64 | 20 6f 76 65 72 6c 6f 61 |tors and| overloa|
|000038d0| 64 65 64 20 73 75 62 70 | 72 6f 67 72 61 6d 73 2e |ded subp|rograms.|
|000038e0| 20 28 41 64 61 20 38 33 | 20 61 6e 64 20 41 64 61 | (Ada 83| and Ada|
|000038f0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 39 35 29 0d |.. | 95).|
|00003900| 0a 20 20 20 20 20 20 20 | 20 20 20 54 68 65 20 70 |. | The p|
|00003910| 72 6f 67 72 61 6d 6d 65 | 72 20 63 61 6e 20 64 65 |rogramme|r can de|
|00003920| 66 69 6e 65 20 68 69 73 | 20 6f 77 6e 20 6f 70 65 |fine his| own ope|
|00003930| 72 61 74 6f 72 73 20 28 | 66 75 6e 63 74 69 6f 6e |rators (|function|
|00003940| 73 20 6c 69 6b 65 0d 0a | 20 20 20 20 20 20 20 20 |s like..| |
|00003950| 20 20 22 2a 22 2c 20 22 | 2b 22 2c 20 22 61 62 73 | "*", "|+", "abs|
|00003960| 22 2c 20 22 78 6f 72 22 | 2c 20 22 6f 72 22 2c 20 |", "xor"|, "or", |
|00003970| 65 74 63 2e 29 20 61 6e | 64 20 64 65 66 69 6e 65 |etc.) an|d define|
|00003980| 20 61 6e 79 20 6e 75 6d | 62 65 72 20 6f 66 0d 0a | any num|ber of..|
|00003990| 20 20 20 20 20 20 20 20 | 20 20 73 75 62 70 72 6f | | subpro|
|000039a0| 67 72 61 6d 73 20 77 69 | 74 68 20 74 68 65 20 73 |grams wi|th the s|
|000039b0| 61 6d 65 20 6e 61 6d 65 | 20 28 70 72 6f 76 69 64 |ame name| (provid|
|000039c0| 65 64 20 74 68 65 79 20 | 68 61 76 65 20 64 69 66 |ed they |have dif|
|000039d0| 66 65 72 65 6e 74 0d 0a | 20 20 20 20 20 20 20 20 |ferent..| |
|000039e0| 20 20 61 72 67 75 6d 65 | 6e 74 20 70 72 6f 66 69 | argume|nt profi|
|000039f0| 6c 65 73 29 2e 0d 0a 0d | 0a 20 20 20 35 2e 20 4d |les)....|. 5. M|
|00003a00| 75 6c 74 69 74 61 73 6b | 69 6e 67 2e 20 28 41 64 |ultitask|ing. (Ad|
|00003a10| 61 20 38 33 20 61 6e 64 | 20 41 64 61 20 39 35 29 |a 83 and| Ada 95)|
|00003a20| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 41 64 61 20 |.. | Ada |
|00003a30| 66 61 63 69 6c 69 74 69 | 65 73 20 66 6f 72 20 63 |faciliti|es for c|
|00003a40| 6f 6e 63 75 72 72 65 6e | 74 20 70 72 6f 67 72 61 |oncurren|t progra|
|00003a50| 6d 6d 69 6e 67 20 28 6d | 75 6c 74 69 74 61 73 6b |mming (m|ultitask|
|00003a60| 69 6e 67 29 20 68 61 76 | 65 0d 0a 20 20 20 20 20 |ing) hav|e.. |
|00003a70| 20 20 20 20 20 74 72 61 | 64 69 74 69 6f 6e 61 6c | tra|ditional|
|00003a80| 6c 79 20 66 6f 75 6e 64 | 20 61 70 70 6c 69 63 61 |ly found| applica|
|00003a90| 74 69 6f 6e 20 69 6e 20 | 73 69 6d 75 6c 61 74 69 |tion in |simulati|
|00003aa0| 6f 6e 73 20 61 6e 64 0d | 0a 20 20 20 20 20 20 20 |ons and.|. |
|00003ab0| 20 20 20 64 69 73 74 72 | 69 62 75 74 65 64 2f 70 | distr|ibuted/p|
|00003ac0| 61 72 61 6c 6c 65 6c 20 | 70 72 6f 67 72 61 6d 6d |arallel |programm|
|00003ad0| 69 6e 67 2e 20 41 64 61 | 20 74 61 73 6b 69 6e 67 |ing. Ada| tasking|
|00003ae0| 20 69 73 20 61 6e 20 65 | 73 70 65 63 69 61 6c 6c | is an e|speciall|
|00003af0| 79 0d 0a 20 20 20 20 20 | 20 20 20 20 20 75 73 65 |y.. | use|
|00003b00| 66 75 6c 20 69 6e 67 72 | 65 64 69 65 6e 74 20 69 |ful ingr|edient i|
|00003b10| 6e 20 74 68 65 20 41 64 | 61 20 39 35 20 64 69 73 |n the Ad|a 95 dis|
|00003b20| 74 72 69 62 75 74 65 64 | 20 70 72 6f 67 72 61 6d |tributed| program|
|00003b30| 6d 69 6e 67 20 6d 6f 64 | 65 6c 2c 0d 0a 20 20 20 |ming mod|el,.. |
|00003b40| 20 20 20 20 20 20 20 61 | 6e 64 20 74 68 65 20 63 | a|nd the c|
|00003b50| 6f 6d 62 69 6e 61 74 69 | 6f 6e 20 6f 66 20 74 68 |ombinati|on of th|
|00003b60| 65 20 74 77 6f 20 6d 61 | 6b 65 73 20 69 74 20 70 |e two ma|kes it p|
|00003b70| 6f 73 73 69 62 6c 65 20 | 74 6f 20 64 65 73 69 67 |ossible |to desig|
|00003b80| 6e 0d 0a 20 20 20 20 20 | 20 20 20 20 20 70 61 72 |n.. | par|
|00003b90| 61 6c 6c 65 6c 20 61 70 | 70 6c 69 63 61 74 69 6f |allel ap|plicatio|
|00003ba0| 6e 73 20 74 68 61 74 20 | 68 61 76 65 20 61 20 68 |ns that |have a h|
|00003bb0| 69 67 68 20 64 65 67 72 | 65 65 20 6f 66 20 6f 70 |igh degr|ee of op|
|00003bc0| 65 72 61 74 69 6e 67 0d | 0a 20 20 20 20 20 20 20 |erating.|. |
|00003bd0| 20 20 20 73 79 73 74 65 | 6d 20 69 6e 64 65 70 65 | syste|m indepe|
|00003be0| 6e 64 65 6e 63 65 20 61 | 6e 64 20 70 6f 72 74 61 |ndence a|nd porta|
|00003bf0| 62 69 6c 69 74 79 2e 20 | 28 4d 6f 72 65 20 6f 6e |bility. |(More on|
|00003c00| 20 74 68 69 73 20 69 6e | 20 69 74 65 6d 20 36 0d | this in| item 6.|
|00003c10| 0a 20 20 20 20 20 20 20 | 20 20 20 62 65 6c 6f 77 |. | below|
|00003c20| 2e 29 0d 0a 0d 0a 20 20 | 20 36 2e 20 44 69 72 65 |.).... | 6. Dire|
|00003c30| 63 74 20 73 75 70 70 6f | 72 74 20 66 6f 72 20 64 |ct suppo|rt for d|
|00003c40| 69 73 74 72 69 62 75 74 | 65 64 2f 70 61 72 61 6c |istribut|ed/paral|
|00003c50| 6c 65 6c 20 63 6f 6d 70 | 75 74 69 6e 67 20 69 6e |lel comp|uting in|
|00003c60| 20 74 68 65 20 6c 61 6e | 67 75 61 67 65 2e 0d 0a | the lan|guage...|
|00003c70| 20 20 20 20 20 20 20 20 | 20 20 28 41 64 61 20 39 | | (Ada 9|
|00003c80| 35 29 0d 0a 20 20 20 20 | 20 20 20 20 20 20 41 64 |5).. | Ad|
|00003c90| 61 20 39 35 20 69 73 20 | 70 72 6f 62 61 62 6c 79 |a 95 is |probably|
|00003ca0| 20 74 68 65 20 66 69 72 | 73 74 20 69 6e 74 65 72 | the fir|st inter|
|00003cb0| 6e 61 74 69 6f 6e 61 6c | 6c 79 20 73 74 61 6e 64 |national|ly stand|
|00003cc0| 61 72 64 69 7a 65 64 0d | 0a 20 20 20 20 20 20 20 |ardized.|. |
|00003cd0| 20 20 20 6c 61 6e 67 75 | 61 67 65 20 74 6f 20 63 | langu|age to c|
|00003ce0| 6f 6d 62 69 6e 65 20 69 | 6e 20 74 68 65 20 73 61 |ombine i|n the sa|
|00003cf0| 6d 65 20 64 65 73 69 67 | 6e 20 63 6f 6d 70 6c 65 |me desig|n comple|
|00003d00| 74 65 20 66 61 63 69 6c | 69 74 69 65 73 20 66 6f |te facil|ities fo|
|00003d10| 72 0d 0a 20 20 20 20 20 | 20 20 20 20 20 6d 75 6c |r.. | mul|
|00003d20| 74 69 74 61 73 6b 69 6e | 67 20 61 6e 64 20 70 61 |titaskin|g and pa|
|00003d30| 72 61 6c 6c 65 6c 20 70 | 72 6f 67 72 61 6d 6d 69 |rallel p|rogrammi|
|00003d40| 6e 67 2e 20 43 6f 6d 6d | 75 6e 69 63 61 74 69 6f |ng. Comm|unicatio|
|00003d50| 6e 20 62 65 74 77 65 65 | 6e 0d 0a 20 20 20 20 20 |n betwee|n.. |
|00003d60| 20 20 20 20 20 74 68 65 | 20 64 69 73 74 72 69 62 | the| distrib|
|00003d70| 75 74 65 64 20 70 61 72 | 74 69 74 69 6f 6e 73 20 |uted par|titions |
|00003d80| 69 73 20 76 69 61 20 73 | 79 6e 63 68 72 6f 6e 6f |is via s|ynchrono|
|00003d90| 75 73 20 61 6e 64 20 61 | 73 79 6e 63 68 72 6f 6e |us and a|synchron|
|00003da0| 6f 75 73 0d 0a 20 20 20 | 20 20 20 20 20 20 20 72 |ous.. | r|
|00003db0| 65 6d 6f 74 65 20 70 72 | 6f 63 65 64 75 72 65 20 |emote pr|ocedure |
|00003dc0| 63 61 6c 6c 73 2e 0d 0a | 0d 0a 20 20 20 20 20 20 |calls...|.. |
|00003dd0| 20 20 20 20 47 6f 6f 64 | 20 64 69 73 63 75 73 73 | Good| discuss|
|00003de0| 69 6f 6e 2c 20 61 6c 6f | 6e 67 20 77 69 74 68 20 |ion, alo|ng with |
|00003df0| 63 6f 64 65 20 65 78 61 | 6d 70 6c 65 73 2c 20 69 |code exa|mples, i|
|00003e00| 73 20 66 6f 75 6e 64 20 | 69 6e 20 74 68 65 0d 0a |s found |in the..|
|00003e10| 20 20 20 20 20 20 20 20 | 20 20 52 61 74 69 6f 6e | | Ration|
|00003e20| 61 6c 65 2c 20 50 61 72 | 74 20 49 49 49 20 45 2c |ale, Par|t III E,|
|00003e30| 20 61 6e 64 20 69 6e 20 | 74 68 65 20 41 64 61 20 | and in |the Ada |
|00003e40| 39 35 20 52 65 66 65 72 | 65 6e 63 65 20 4d 61 6e |95 Refer|ence Man|
|00003e50| 75 61 6c 2c 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ual,.. | |
|00003e60| 41 6e 6e 65 78 20 45 2e | 20 53 65 65 20 61 6c 73 |Annex E.| See als|
|00003e70| 6f 20 22 41 64 61 20 4c | 65 74 74 65 72 73 22 2c |o "Ada L|etters",|
|00003e80| 20 56 6f 6c 2e 20 31 33 | 2c 20 4e 6f 2e 20 32 20 | Vol. 13|, No. 2 |
|00003e90| 28 31 39 39 33 29 2c 20 | 70 70 2e 20 35 34 0d 0a |(1993), |pp. 54..|
|00003ea0| 20 20 20 20 20 20 20 20 | 20 20 61 6e 64 20 37 38 | | and 78|
|00003eb0| 2c 20 61 6e 64 20 56 6f | 6c 2e 20 31 34 2c 20 4e |, and Vo|l. 14, N|
|00003ec0| 6f 2e 20 32 20 28 31 39 | 39 34 29 2c 20 70 2e 20 |o. 2 (19|94), p. |
|00003ed0| 38 30 2e 20 28 46 75 6c | 6c 20 73 75 70 70 6f 72 |80. (Ful|l suppor|
|00003ee0| 74 20 66 6f 72 0d 0a 20 | 20 20 20 20 20 20 20 20 |t for.. | |
|00003ef0| 20 74 68 65 73 65 20 66 | 65 61 74 75 72 65 73 20 | these f|eatures |
|00003f00| 69 73 20 70 72 6f 76 69 | 64 65 64 20 62 79 20 63 |is provi|ded by c|
|00003f10| 6f 6d 70 69 6c 65 72 73 | 20 74 68 61 74 20 63 6f |ompilers| that co|
|00003f20| 6e 66 6f 72 6d 20 74 6f | 20 74 68 65 20 41 64 61 |nform to| the Ada|
|00003f30| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 39 35 20 64 |.. | 95 d|
|00003f40| 69 73 74 72 69 62 75 74 | 65 64 20 63 6f 6d 70 75 |istribut|ed compu|
|00003f50| 74 69 6e 67 20 41 6e 6e | 65 78 2e 20 54 68 69 73 |ting Ann|ex. This|
|00003f60| 20 63 6f 6e 66 6f 72 6d | 61 6e 63 65 20 69 73 20 | conform|ance is |
|00003f70| 6f 70 74 69 6f 6e 61 6c | 2c 0d 0a 20 20 20 20 20 |optional|,.. |
|00003f80| 20 20 20 20 20 62 75 74 | 20 66 6f 72 20 69 6e 73 | but| for ins|
|00003f90| 74 61 6e 63 65 20 47 4e | 41 54 2c 20 74 68 65 20 |tance GN|AT, the |
|00003fa0| 47 6e 75 20 41 64 61 20 | 39 35 20 63 6f 6d 70 69 |Gnu Ada |95 compi|
|00003fb0| 6c 65 72 2c 20 77 69 6c | 6c 20 6d 65 65 74 20 74 |ler, wil|l meet t|
|00003fc0| 68 65 73 65 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |hese.. | |
|00003fd0| 72 65 71 75 69 72 65 6d | 65 6e 74 73 2e 29 0d 0a |requirem|ents.)..|
|00003fe0| 0d 0a 20 20 20 37 2e 20 | 41 74 74 72 69 62 75 74 |.. 7. |Attribut|
|00003ff0| 65 73 20 6f 66 20 66 6c | 6f 61 74 69 6e 67 20 70 |es of fl|oating p|
|00004000| 6f 69 6e 74 20 74 79 70 | 65 73 2e 20 28 41 64 61 |oint typ|es. (Ada|
|00004010| 20 38 33 20 61 6e 64 20 | 41 64 61 20 39 35 29 0d | 83 and |Ada 95).|
|00004020| 0a 20 20 20 20 20 20 20 | 20 20 20 46 6f 72 20 65 |. | For e|
|00004030| 76 65 72 79 20 66 6c 6f | 61 74 69 6e 67 20 70 6f |very flo|ating po|
|00004040| 69 6e 74 20 74 79 70 65 | 20 28 69 6e 63 6c 75 64 |int type| (includ|
|00004050| 69 6e 67 20 75 73 65 72 | 20 64 65 66 69 6e 65 64 |ing user| defined|
|00004060| 20 74 79 70 65 73 29 2c | 0d 0a 20 20 20 20 20 20 | types),|.. |
|00004070| 20 20 20 20 74 68 65 72 | 65 20 61 72 65 20 62 75 | ther|e are bu|
|00004080| 69 6c 74 2d 69 6e 20 66 | 75 6e 63 74 69 6f 6e 73 |ilt-in f|unctions|
|00004090| 20 74 68 61 74 20 72 65 | 74 75 72 6e 20 74 68 65 | that re|turn the|
|000040a0| 20 65 73 73 65 6e 74 69 | 61 6c 0d 0a 20 20 20 20 | essenti|al.. |
|000040b0| 20 20 20 20 20 20 63 68 | 61 72 61 63 74 65 72 69 | ch|aracteri|
|000040c0| 73 74 69 63 73 20 6f 66 | 20 74 68 65 20 74 79 70 |stics of| the typ|
|000040d0| 65 2e 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 2c 20 |e. For e|xample, |
|000040e0| 69 66 20 79 6f 75 20 64 | 65 63 6c 61 72 65 20 22 |if you d|eclare "|
|000040f0| 74 79 70 65 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |type.. | |
|00004100| 52 65 61 6c 20 69 73 20 | 64 69 67 69 74 73 20 31 |Real is |digits 1|
|00004110| 35 22 20 74 68 65 6e 20 | 79 6f 75 20 63 61 6e 20 |5" then |you can |
|00004120| 67 65 74 20 74 68 65 20 | 6d 61 78 20 65 78 70 6f |get the |max expo|
|00004130| 6e 65 6e 74 20 6f 66 20 | 6f 62 6a 65 63 74 73 0d |nent of |objects.|
|00004140| 0a 20 20 20 20 20 20 20 | 20 20 20 6f 66 20 74 79 |. | of ty|
|00004150| 70 65 20 52 65 61 6c 20 | 66 72 6f 6d 20 52 65 61 |pe Real |from Rea|
|00004160| 6c 27 4d 61 63 68 69 6e | 65 5f 45 6d 61 78 2e 20 |l'Machin|e_Emax. |
|00004170| 53 69 6d 69 6c 61 72 6c | 79 2c 20 74 68 65 20 73 |Similarl|y, the s|
|00004180| 69 7a 65 20 6f 66 20 74 | 68 65 0d 0a 20 20 20 20 |ize of t|he.. |
|00004190| 20 20 20 20 20 20 4d 61 | 6e 74 69 73 73 61 2c 20 | Ma|ntissa, |
|000041a0| 74 68 65 20 52 61 64 69 | 78 2c 20 74 68 65 20 6c |the Radi|x, the l|
|000041b0| 61 72 67 65 73 74 20 52 | 65 61 6c 2c 20 61 6e 64 |argest R|eal, and|
|000041c0| 20 74 68 65 20 52 6f 75 | 6e 64 69 6e 67 20 70 6f | the Rou|nding po|
|000041d0| 6c 69 63 79 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |licy.. | |
|000041e0| 6f 66 20 74 68 65 20 61 | 72 69 74 68 6d 65 74 69 |of the a|rithmeti|
|000041f0| 63 20 61 72 65 20 67 69 | 76 65 6e 20 62 79 20 52 |c are gi|ven by R|
|00004200| 65 61 6c 27 4d 61 63 68 | 69 6e 65 5f 4d 61 6e 74 |eal'Mach|ine_Mant|
|00004210| 69 73 73 61 2c 0d 0a 20 | 20 20 20 20 20 20 20 20 |issa,.. | |
|00004220| 20 52 65 61 6c 27 4d 61 | 63 68 69 6e 65 5f 52 61 | Real'Ma|chine_Ra|
|00004230| 64 69 78 2c 20 52 65 61 | 6c 27 4c 61 73 74 2c 20 |dix, Rea|l'Last, |
|00004240| 61 6e 64 20 52 65 61 6c | 27 4d 61 63 68 69 6e 65 |and Real|'Machine|
|00004250| 5f 52 6f 75 6e 64 73 2e | 20 54 68 65 72 65 0d 0a |_Rounds.| There..|
|00004260| 20 20 20 20 20 20 20 20 | 20 20 61 72 65 20 6d 61 | | are ma|
|00004270| 6e 79 20 6f 74 68 65 72 | 73 2e 0d 0a 0d 0a 20 20 |ny other|s..... |
|00004280| 20 20 20 20 20 20 20 20 | 28 53 65 65 20 41 64 61 | |(See Ada|
|00004290| 20 39 35 20 52 65 66 65 | 72 65 6e 63 65 20 4d 61 | 95 Refe|rence Ma|
|000042a0| 6e 75 61 6c 2c 20 63 6c | 61 75 73 65 20 33 2e 35 |nual, cl|ause 3.5|
|000042b0| 2c 20 73 75 62 63 6c 61 | 75 73 65 20 33 2e 35 2e |, subcla|use 3.5.|
|000042c0| 38 20 61 6e 64 0d 0a 20 | 20 20 20 20 20 20 20 20 |8 and.. | |
|000042d0| 20 41 2e 35 2e 33 2c 20 | 61 73 20 77 65 6c 6c 20 | A.5.3, |as well |
|000042e0| 61 73 20 50 61 72 74 20 | 49 49 49 20 73 65 63 74 |as Part |III sect|
|000042f0| 69 6f 6e 73 20 47 2e 32 | 20 61 6e 64 20 47 2e 34 |ions G.2| and G.4|
|00004300| 2e 31 20 6f 66 20 74 68 | 65 20 41 64 61 20 39 35 |.1 of th|e Ada 95|
|00004310| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 52 61 74 69 |.. | Rati|
|00004320| 6f 6e 61 6c 65 2e 29 0d | 0a 0d 0a 20 20 20 38 2e |onale.).|... 8.|
|00004330| 20 41 74 74 72 69 62 75 | 74 65 20 66 75 6e 63 74 | Attribu|te funct|
|00004340| 69 6f 6e 73 20 66 6f 72 | 20 66 6c 6f 61 74 69 6e |ions for| floatin|
|00004350| 67 20 70 6f 69 6e 74 20 | 74 79 70 65 73 2e 20 28 |g point |types. (|
|00004360| 41 64 61 20 39 35 29 0d | 0a 20 20 20 20 20 20 20 |Ada 95).|. |
|00004370| 20 20 20 46 6f 72 20 65 | 76 65 72 79 20 66 6c 6f | For e|very flo|
|00004380| 61 74 69 6e 67 20 70 6f | 69 6e 74 20 74 79 70 65 |ating po|int type|
|00004390| 20 28 69 6e 63 6c 75 64 | 69 6e 67 20 75 73 65 72 | (includ|ing user|
|000043a0| 20 64 65 66 69 6e 65 64 | 20 74 79 70 65 73 29 2c | defined| types),|
|000043b0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 74 68 65 72 |.. | ther|
|000043c0| 65 20 61 72 65 20 62 75 | 69 6c 74 2d 69 6e 20 66 |e are bu|ilt-in f|
|000043d0| 75 6e 63 74 69 6f 6e 73 | 20 74 68 61 74 20 6f 70 |unctions| that op|
|000043e0| 65 72 61 74 65 20 6f 6e | 20 6f 62 6a 65 63 74 73 |erate on| objects|
|000043f0| 20 6f 66 20 74 68 61 74 | 0d 0a 20 20 20 20 20 20 | of that|.. |
|00004400| 20 20 20 20 74 79 70 65 | 2e 20 46 6f 72 20 65 78 | type|. For ex|
|00004410| 61 6d 70 6c 65 2c 20 69 | 66 20 79 6f 75 20 64 65 |ample, i|f you de|
|00004420| 63 6c 61 72 65 20 22 74 | 79 70 65 20 52 65 61 6c |clare "t|ype Real|
|00004430| 20 69 73 20 64 69 67 69 | 74 73 20 31 35 22 20 74 | is digi|ts 15" t|
|00004440| 68 65 6e 0d 0a 20 20 20 | 20 20 20 20 20 20 20 52 |hen.. | R|
|00004450| 65 61 6c 27 52 65 6d 61 | 69 6e 64 65 72 20 28 58 |eal'Rema|inder (X|
|00004460| 2c 20 59 29 20 72 65 74 | 75 72 6e 73 20 74 68 65 |, Y) ret|urns the|
|00004470| 20 65 78 61 63 74 20 72 | 65 6d 61 69 6e 64 65 72 | exact r|emainder|
|00004480| 20 6f 66 20 58 20 61 6e | 64 20 59 3a 20 58 0d 0a | of X an|d Y: X..|
|00004490| 20 20 20 20 20 20 20 20 | 20 20 2d 20 6e 2a 59 20 | | - n*Y |
|000044a0| 77 68 65 72 65 20 6e 20 | 69 73 20 74 68 65 20 69 |where n |is the i|
|000044b0| 6e 74 65 67 65 72 20 6e | 65 61 72 65 73 74 20 58 |nteger n|earest X|
|000044c0| 2f 59 2e 20 52 65 61 6c | 27 54 72 75 6e 63 61 74 |/Y. Real|'Truncat|
|000044d0| 69 6f 6e 28 58 29 2c 0d | 0a 20 20 20 20 20 20 20 |ion(X),.|. |
|000044e0| 20 20 20 52 65 61 6c 27 | 4d 61 78 28 58 2c 59 29 | Real'|Max(X,Y)|
|000044f0| 2c 20 52 65 61 6c 27 52 | 6f 75 6e 64 69 6e 67 28 |, Real'R|ounding(|
|00004500| 58 29 20 68 61 76 65 20 | 74 68 65 20 75 73 75 61 |X) have |the usua|
|00004510| 6c 20 6d 65 61 6e 69 6e | 67 73 2e 0d 0a 20 20 20 |l meanin|gs... |
|00004520| 20 20 20 20 20 20 20 52 | 65 61 6c 27 46 72 61 63 | R|eal'Frac|
|00004530| 74 69 6f 6e 28 58 29 20 | 61 6e 64 20 52 65 61 6c |tion(X) |and Real|
|00004540| 27 45 78 70 6f 6e 65 6e | 74 28 58 29 20 62 72 65 |'Exponen|t(X) bre|
|00004550| 61 6b 20 58 20 69 6e 74 | 6f 20 6d 61 6e 74 69 73 |ak X int|o mantis|
|00004560| 73 61 20 61 6e 64 0d 0a | 20 20 20 20 20 20 20 20 |sa and..| |
|00004570| 20 20 65 78 70 6f 6e 65 | 6e 74 3b 20 52 65 61 6c | expone|nt; Real|
|00004580| 27 53 63 61 6c 69 6e 67 | 28 58 2c 20 4e 29 20 69 |'Scaling|(X, N) i|
|00004590| 73 20 65 78 61 63 74 20 | 73 63 61 6c 69 6e 67 3a |s exact |scaling:|
|000045a0| 20 6d 75 6c 74 69 70 6c | 69 65 73 20 58 20 62 79 | multipl|ies X by|
|000045b0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 52 61 64 69 |.. | Radi|
|000045c0| 78 2a 2a 4e 2c 20 77 68 | 69 63 68 20 63 61 6e 20 |x**N, wh|ich can |
|000045d0| 62 65 20 64 6f 6e 65 20 | 62 79 20 69 6e 63 72 65 |be done |by incre|
|000045e0| 6d 65 6e 74 69 6e 67 20 | 74 68 65 20 65 78 70 6f |menting |the expo|
|000045f0| 6e 65 6e 74 20 62 79 20 | 4e 2c 0d 0a 20 20 20 20 |nent by |N,.. |
|00004600| 20 20 20 20 20 20 65 74 | 63 2e 20 28 53 65 65 20 | et|c. (See |
|00004610| 63 69 74 61 74 69 6f 6e | 73 20 69 6e 20 69 74 65 |citation|s in ite|
|00004620| 6d 20 37 2e 29 0d 0a 0d | 0a 20 20 20 39 2e 20 4d |m 7.)...|. 9. M|
|00004630| 6f 64 75 6c 61 72 20 61 | 72 69 74 68 6d 65 74 69 |odular a|rithmeti|
|00004640| 63 20 6f 6e 20 69 6e 74 | 65 67 65 72 20 74 79 70 |c on int|eger typ|
|00004650| 65 73 2e 20 28 41 64 61 | 20 39 35 29 0d 0a 20 20 |es. (Ada| 95).. |
|00004660| 20 20 20 20 20 20 20 20 | 49 66 20 79 6f 75 20 64 | |If you d|
|00004670| 65 63 6c 61 72 65 20 22 | 74 79 70 65 20 4d 79 5f |eclare "|type My_|
|00004680| 55 6e 73 69 67 6e 65 64 | 20 69 73 20 6d 6f 64 20 |Unsigned| is mod |
|00004690| 4e 22 2c 20 66 6f 72 20 | 61 72 62 69 74 72 61 72 |N", for |arbitrar|
|000046a0| 79 20 4e 2c 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |y N,.. | |
|000046b0| 74 68 65 6e 20 61 72 69 | 74 68 6d 65 74 69 63 20 |then ari|thmetic |
|000046c0| 28 22 2a 22 2c 20 22 2b | 22 2c 20 65 74 63 2e 29 |("*", "+|", etc.)|
|000046d0| 20 6f 6e 20 6f 62 6a 65 | 63 74 73 20 6f 66 20 74 | on obje|cts of t|
|000046e0| 79 70 65 20 4d 79 5f 55 | 6e 73 69 67 6e 65 64 0d |ype My_U|nsigned.|
|000046f0| 0a 20 20 20 20 20 20 20 | 20 20 20 72 65 74 75 72 |. | retur|
|00004700| 6e 73 20 74 68 65 20 72 | 65 73 75 6c 74 73 20 6d |ns the r|esults m|
|00004710| 6f 64 75 6c 6f 20 4e 2e | 20 42 6f 6f 6c 65 61 6e |odulo N.| Boolean|
|00004720| 20 6f 70 65 72 61 74 6f | 72 73 20 22 61 6e 64 22 | operato|rs "and"|
|00004730| 2c 20 22 6f 72 22 2c 0d | 0a 20 20 20 20 20 20 20 |, "or",.|. |
|00004740| 20 20 20 22 78 6f 72 22 | 2c 20 61 6e 64 20 22 6e | "xor"|, and "n|
|00004750| 6f 74 22 20 61 72 65 20 | 64 65 66 69 6e 65 64 20 |ot" are |defined |
|00004760| 6f 6e 20 74 68 65 20 6f | 62 6a 65 63 74 73 20 61 |on the o|bjects a|
|00004770| 73 20 74 68 6f 75 67 68 | 20 74 68 65 79 20 77 65 |s though| they we|
|00004780| 72 65 0d 0a 20 20 20 20 | 20 20 20 20 20 20 61 72 |re.. | ar|
|00004790| 72 61 79 73 20 6f 66 20 | 62 69 74 73 20 28 61 6e |rays of |bits (an|
|000047a0| 64 20 6c 69 6b 65 77 69 | 73 65 20 72 65 74 75 72 |d likewi|se retur|
|000047b0| 6e 20 72 65 73 75 6c 74 | 73 20 6d 6f 64 75 6c 6f |n result|s modulo|
|000047c0| 20 4e 29 2e 20 46 6f 72 | 20 4e 20 61 0d 0a 20 20 | N). For| N a.. |
|000047d0| 20 20 20 20 20 20 20 20 | 70 6f 77 65 72 20 6f 66 | |power of|
|000047e0| 20 32 2c 20 74 68 65 20 | 73 65 6d 61 6e 74 69 63 | 2, the |semantic|
|000047f0| 73 20 61 72 65 20 73 69 | 6d 69 6c 61 72 20 74 6f |s are si|milar to|
|00004800| 20 74 68 6f 73 65 20 6f | 66 20 43 20 75 6e 73 69 | those o|f C unsi|
|00004810| 67 6e 65 64 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |gned.. | |
|00004820| 74 79 70 65 73 2e 0d 0a | 0d 0a 20 20 20 31 30 2e |types...|.. 10.|
|00004830| 20 47 65 6e 65 72 69 63 | 20 65 6c 65 6d 65 6e 74 | Generic| element|
|00004840| 61 72 79 20 6d 61 74 68 | 20 66 75 6e 63 74 69 6f |ary math| functio|
|00004850| 6e 73 20 66 6f 72 20 66 | 6c 6f 61 74 69 6e 67 20 |ns for f|loating |
|00004860| 70 6f 69 6e 74 20 74 79 | 70 65 73 2e 20 28 41 64 |point ty|pes. (Ad|
|00004870| 61 0d 0a 20 20 20 20 20 | 20 20 20 20 20 39 35 29 |a.. | 95)|
|00004880| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 52 65 71 75 |.. | Requ|
|00004890| 69 72 65 64 20 6f 66 20 | 61 6c 6c 20 63 6f 6d 70 |ired of |all comp|
|000048a0| 69 6c 65 72 73 2c 20 61 | 6e 64 20 70 72 6f 76 69 |ilers, a|nd provi|
|000048b0| 64 65 64 20 66 6f 72 20 | 61 6e 79 20 66 6c 6f 61 |ded for |any floa|
|000048c0| 74 69 6e 67 20 70 6f 69 | 6e 74 0d 0a 20 20 20 20 |ting poi|nt.. |
|000048d0| 20 20 20 20 20 20 74 79 | 70 65 3a 20 53 71 72 74 | ty|pe: Sqrt|
|000048e0| 2c 20 43 6f 73 2c 20 53 | 69 6e 2c 20 54 61 6e 2c |, Cos, S|in, Tan,|
|000048f0| 20 43 6f 74 2c 20 45 78 | 70 2c 20 53 69 6e 68 2c | Cot, Ex|p, Sinh,|
|00004900| 20 43 6f 73 68 2c 20 54 | 61 6e 68 2c 20 43 6f 74 | Cosh, T|anh, Cot|
|00004910| 68 2c 0d 0a 20 20 20 20 | 20 20 20 20 20 20 61 6e |h,.. | an|
|00004920| 64 20 74 68 65 20 69 6e | 76 65 72 73 65 20 66 75 |d the in|verse fu|
|00004930| 6e 63 74 69 6f 6e 73 20 | 6f 66 20 65 61 63 68 20 |nctions |of each |
|00004940| 6f 66 20 74 68 65 73 65 | 2c 20 41 72 63 74 61 6e |of these|, Arctan|
|00004950| 2c 20 4c 6f 67 2c 0d 0a | 20 20 20 20 20 20 20 20 |, Log,..| |
|00004960| 20 20 41 72 63 73 69 6e | 68 2c 20 65 74 63 2e 20 | Arcsin|h, etc. |
|00004970| 41 6c 73 6f 2c 20 58 2a | 2a 59 20 66 6f 72 20 66 |Also, X*|*Y for f|
|00004980| 6c 6f 61 74 69 6e 67 20 | 70 6f 69 6e 74 20 58 20 |loating |point X |
|00004990| 61 6e 64 20 59 2e 20 43 | 6f 6d 70 69 6c 65 72 73 |and Y. C|ompilers|
|000049a0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 74 68 61 74 |.. | that|
|000049b0| 20 63 6f 6e 66 6f 72 6d | 20 74 6f 20 74 68 65 20 | conform| to the |
|000049c0| 4e 75 6d 65 72 69 63 73 | 20 41 6e 6e 65 78 20 6d |Numerics| Annex m|
|000049d0| 65 65 74 20 61 64 64 69 | 74 69 6f 6e 61 6c 20 61 |eet addi|tional a|
|000049e0| 63 63 75 72 61 63 79 0d | 0a 20 20 20 20 20 20 20 |ccuracy.|. |
|000049f0| 20 20 20 72 65 71 75 69 | 72 65 6d 65 6e 74 73 2e | requi|rements.|
|00004a00| 0d 0a 0d 0a 20 20 20 20 | 20 20 20 20 20 20 28 53 |.... | (S|
|00004a10| 65 65 20 73 75 62 63 6c | 61 75 73 65 20 41 2e 35 |ee subcl|ause A.5|
|00004a20| 2e 31 20 6f 66 20 74 68 | 65 20 41 64 61 20 39 35 |.1 of th|e Ada 95|
|00004a30| 20 52 4d 2c 20 61 6e 64 | 20 50 61 72 74 20 49 49 | RM, and| Part II|
|00004a40| 49 2c 20 53 65 63 74 69 | 6f 6e 0d 0a 20 20 20 20 |I, Secti|on.. |
|00004a50| 20 20 20 20 20 20 41 2e | 33 20 6f 66 20 74 68 65 | A.|3 of the|
|00004a60| 20 41 64 61 20 39 35 20 | 52 61 74 69 6f 6e 61 6c | Ada 95 |Rational|
|00004a70| 65 2e 29 0d 0a 0d 0a 20 | 20 20 31 31 2e 20 43 6f |e.).... | 11. Co|
|00004a80| 6d 70 6c 65 78 20 6e 75 | 6d 62 65 72 73 2e 20 28 |mplex nu|mbers. (|
|00004a90| 41 64 61 20 39 35 29 0d | 0a 20 20 20 20 20 20 20 |Ada 95).|. |
|00004aa0| 20 20 20 46 6f 72 74 72 | 61 6e 2d 6c 69 6b 65 2c | Fortr|an-like,|
|00004ab0| 20 62 75 74 20 77 69 74 | 68 20 61 20 6e 65 77 20 | but wit|h a new |
|00004ac0| 74 79 70 65 20 63 61 6c | 6c 65 64 20 49 6d 61 67 |type cal|led Imag|
|00004ad0| 69 6e 61 72 79 2e 20 54 | 79 70 65 0d 0a 20 20 20 |inary. T|ype.. |
|00004ae0| 20 20 20 20 20 20 20 22 | 49 6d 61 67 69 6e 61 72 | "|Imaginar|
|00004af0| 79 22 20 61 6c 6c 6f 77 | 73 20 70 72 6f 67 72 61 |y" allow|s progra|
|00004b00| 6d 6d 65 72 73 20 74 6f | 20 77 72 69 74 65 20 65 |mmers to| write e|
|00004b10| 78 70 72 65 73 73 69 6f | 6e 73 20 69 6e 20 73 75 |xpressio|ns in su|
|00004b20| 63 68 20 61 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ch a.. | |
|00004b30| 77 61 79 20 74 68 61 74 | 20 74 68 65 79 20 61 72 |way that| they ar|
|00004b40| 65 20 65 61 73 69 65 72 | 20 74 6f 20 6f 70 74 69 |e easier| to opti|
|00004b50| 6d 69 7a 65 2c 20 6d 6f | 72 65 20 72 65 61 64 61 |mize, mo|re reada|
|00004b60| 62 6c 65 20 61 6e 64 20 | 61 70 70 65 61 72 0d 0a |ble and |appear..|
|00004b70| 20 20 20 20 20 20 20 20 | 20 20 69 6e 20 63 6f 64 | | in cod|
|00004b80| 65 20 61 73 20 74 68 65 | 79 20 61 70 70 65 61 72 |e as the|y appear|
|00004b90| 20 6f 6e 20 70 61 70 65 | 72 2e 20 41 6c 73 6f 2c | on pape|r. Also,|
|00004ba0| 20 74 68 65 20 61 62 69 | 6c 69 74 79 20 74 6f 20 | the abi|lity to |
|00004bb0| 64 65 63 6c 61 72 65 0d | 0a 20 20 20 20 20 20 20 |declare.|. |
|00004bc0| 20 20 20 6f 62 6a 65 63 | 74 20 6f 66 20 70 75 72 | objec|t of pur|
|00004bd0| 65 20 69 6d 61 67 69 6e | 61 72 79 20 74 79 70 65 |e imagin|ary type|
|00004be0| 20 72 65 64 75 63 65 73 | 20 74 68 65 20 6e 75 6d | reduces| the num|
|00004bf0| 62 65 72 20 6f 66 20 63 | 61 73 65 73 20 69 6e 0d |ber of c|ases in.|
|00004c00| 0a 20 20 20 20 20 20 20 | 20 20 20 77 68 69 63 68 |. | which|
|00004c10| 20 70 72 65 6d 61 74 75 | 72 65 20 74 79 70 65 20 | prematu|re type |
|00004c20| 63 6f 6e 76 65 72 73 69 | 6f 6e 20 6f 66 20 72 65 |conversi|on of re|
|00004c30| 61 6c 20 6e 75 6d 62 65 | 72 73 20 74 6f 20 63 6f |al numbe|rs to co|
|00004c40| 6d 70 6c 65 78 0d 0a 20 | 20 20 20 20 20 20 20 20 |mplex.. | |
|00004c50| 20 63 61 75 73 65 73 20 | 66 6c 6f 61 74 69 6e 67 | causes |floating|
|00004c60| 20 70 6f 69 6e 74 20 65 | 78 63 65 70 74 69 6f 6e | point e|xception|
|00004c70| 73 20 74 6f 20 6f 63 63 | 75 72 2e 20 28 50 72 6f |s to occ|ur. (Pro|
|00004c80| 76 69 64 65 64 20 62 79 | 0d 0a 20 20 20 20 20 20 |vided by|.. |
|00004c90| 20 20 20 20 63 6f 6d 70 | 69 6c 65 72 73 20 74 68 | comp|ilers th|
|00004ca0| 61 74 20 63 6f 6e 66 6f | 72 6d 20 74 6f 20 74 68 |at confo|rm to th|
|00004cb0| 65 20 4e 75 6d 65 72 69 | 63 73 20 41 6e 6e 65 78 |e Numeri|cs Annex|
|00004cc0| 2e 20 54 68 65 20 47 6e | 75 20 41 64 61 20 39 35 |. The Gn|u Ada 95|
|00004cd0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 63 6f 6d 70 |.. | comp|
|00004ce0| 69 6c 65 72 20 73 75 70 | 70 6f 72 74 73 20 74 68 |iler sup|ports th|
|00004cf0| 69 73 20 61 6e 6e 65 78 | 2c 20 73 6f 20 74 68 65 |is annex|, so the|
|00004d00| 20 73 6f 75 72 63 65 20 | 63 6f 64 65 20 69 73 20 | source |code is |
|00004d10| 66 72 65 65 6c 79 0d 0a | 20 20 20 20 20 20 20 20 |freely..| |
|00004d20| 20 20 61 76 61 69 6c 61 | 62 6c 65 2e 29 0d 0a 0d | availa|ble.)...|
|00004d30| 0a 20 20 20 31 32 2e 20 | 47 65 6e 65 72 69 63 20 |. 12. |Generic |
|00004d40| 65 6c 65 6d 65 6e 74 61 | 72 79 20 6d 61 74 68 20 |elementa|ry math |
|00004d50| 66 75 6e 63 74 69 6f 6e | 73 20 66 6f 72 20 63 6f |function|s for co|
|00004d60| 6d 70 6c 65 78 20 6e 75 | 6d 62 65 72 20 74 79 70 |mplex nu|mber typ|
|00004d70| 65 73 2e 20 28 41 64 61 | 0d 0a 20 20 20 20 20 20 |es. (Ada|.. |
|00004d80| 20 20 20 20 39 35 29 0d | 0a 20 20 20 20 20 20 20 | 95).|. |
|00004d90| 20 20 20 53 61 6d 65 20 | 66 75 6e 63 74 69 6f 6e | Same |function|
|00004da0| 73 20 73 75 70 70 6f 72 | 74 65 64 20 66 6f 72 20 |s suppor|ted for |
|00004db0| 72 65 61 6c 20 74 79 70 | 65 73 2c 20 62 75 74 20 |real typ|es, but |
|00004dc0| 77 69 74 68 20 63 6f 6d | 70 6c 65 78 0d 0a 20 20 |with com|plex.. |
|00004dd0| 20 20 20 20 20 20 20 20 | 61 72 67 75 6d 65 6e 74 | |argument|
|00004de0| 73 2e 20 53 74 61 6e 64 | 61 72 64 20 49 4f 20 69 |s. Stand|ard IO i|
|00004df0| 73 20 70 72 6f 76 69 64 | 65 64 20 66 6f 72 20 66 |s provid|ed for f|
|00004e00| 6c 6f 61 74 69 6e 67 20 | 70 6f 69 6e 74 20 74 79 |loating |point ty|
|00004e10| 70 65 73 20 61 6e 64 0d | 0a 20 20 20 20 20 20 20 |pes and.|. |
|00004e20| 20 20 20 43 6f 6d 70 6c | 65 78 20 74 79 70 65 73 | Compl|ex types|
|00004e30| 2e 20 28 4f 6e 6c 79 20 | 72 65 71 75 69 72 65 64 |. (Only |required|
|00004e40| 20 6f 66 20 63 6f 6d 70 | 69 6c 65 72 73 20 74 68 | of comp|ilers th|
|00004e50| 61 74 20 73 75 70 70 6f | 72 74 20 74 68 65 0d 0a |at suppo|rt the..|
|00004e60| 20 20 20 20 20 20 20 20 | 20 20 4e 75 6d 65 72 69 | | Numeri|
|00004e70| 63 73 20 41 6e 6e 65 78 | 2c 20 6c 69 6b 65 20 47 |cs Annex|, like G|
|00004e80| 6e 75 20 41 64 61 2e 29 | 0d 0a 0d 0a 20 20 20 31 |nu Ada.)|.... 1|
|00004e90| 33 2e 20 50 73 65 75 64 | 6f 2d 72 61 6e 64 6f 6d |3. Pseud|o-random|
|00004ea0| 20 6e 75 6d 62 65 72 73 | 20 66 6f 72 20 64 69 73 | numbers| for dis|
|00004eb0| 63 72 65 74 65 20 61 6e | 64 20 66 6c 6f 61 74 69 |crete an|d floati|
|00004ec0| 6e 67 20 70 6f 69 6e 74 | 20 74 79 70 65 73 2e 20 |ng point| types. |
|00004ed0| 28 41 64 61 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |(Ada.. | |
|00004ee0| 39 35 29 0d 0a 20 20 20 | 20 20 20 20 20 20 20 41 |95).. | A|
|00004ef0| 20 66 6c 6f 61 74 69 6e | 67 20 70 6f 69 6e 74 20 | floatin|g point |
|00004f00| 70 73 65 75 64 6f 2d 72 | 61 6e 64 6f 6d 20 6e 75 |pseudo-r|andom nu|
|00004f10| 6d 62 65 72 20 67 65 6e | 65 72 61 74 6f 72 20 28 |mber gen|erator (|
|00004f20| 50 52 4e 47 29 20 70 72 | 6f 76 69 64 65 73 0d 0a |PRNG) pr|ovides..|
|00004f30| 20 20 20 20 20 20 20 20 | 20 20 6f 75 74 70 75 74 | | output|
|00004f40| 20 69 6e 20 74 68 65 20 | 72 61 6e 67 65 20 30 2e | in the |range 0.|
|00004f50| 30 20 2e 2e 20 31 2e 30 | 2e 20 44 69 73 63 72 65 |0 .. 1.0|. Discre|
|00004f60| 74 65 3a 20 41 20 67 65 | 6e 65 72 69 63 20 50 52 |te: A ge|neric PR|
|00004f70| 4e 47 0d 0a 20 20 20 20 | 20 20 20 20 20 20 70 61 |NG.. | pa|
|00004f80| 63 6b 61 67 65 20 69 73 | 20 70 72 6f 76 69 64 65 |ckage is| provide|
|00004f90| 64 20 74 68 61 74 20 63 | 61 6e 20 62 65 20 69 6e |d that c|an be in|
|00004fa0| 73 74 61 6e 74 69 61 74 | 65 64 20 77 69 74 68 20 |stantiat|ed with |
|00004fb0| 61 6e 79 20 64 69 73 63 | 72 65 74 65 0d 0a 20 20 |any disc|rete.. |
|00004fc0| 20 20 20 20 20 20 20 20 | 74 79 70 65 3a 20 42 6f | |type: Bo|
|00004fd0| 6f 6c 65 61 6e 2c 20 49 | 6e 74 65 67 65 72 2c 20 |olean, I|nteger, |
|00004fe0| 4d 6f 64 75 6c 61 72 20 | 65 74 63 2e 20 54 68 65 |Modular |etc. The|
|00004ff0| 20 66 6c 6f 61 74 69 6e | 67 20 70 6f 69 6e 74 20 | floatin|g point |
|00005000| 50 52 4e 47 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |PRNG.. | |
|00005010| 70 61 63 6b 61 67 65 20 | 61 6e 64 20 69 6e 73 74 |package |and inst|
|00005020| 61 6e 63 65 73 20 6f 66 | 20 74 68 65 20 28 64 69 |ances of| the (di|
|00005030| 73 63 72 65 74 65 29 20 | 50 52 4e 47 20 70 61 63 |screte) |PRNG pac|
|00005040| 6b 61 67 65 20 61 72 65 | 0d 0a 20 20 20 20 20 20 |kage are|.. |
|00005050| 20 20 20 20 69 6e 64 69 | 76 69 64 75 61 6c 6c 79 | indi|vidually|
|00005060| 20 63 61 70 61 62 6c 65 | 20 6f 66 20 70 72 6f 64 | capable| of prod|
|00005070| 75 63 69 6e 67 20 69 6e | 64 65 70 65 6e 64 65 6e |ucing in|dependen|
|00005080| 74 20 73 74 72 65 61 6d | 73 20 6f 66 20 72 61 6e |t stream|s of ran|
|00005090| 64 6f 6d 0d 0a 20 20 20 | 20 20 20 20 20 20 20 6e |dom.. | n|
|000050a0| 75 6d 62 65 72 73 2e 20 | 53 74 72 65 61 6d 73 20 |umbers. |Streams |
|000050b0| 6d 61 79 20 62 65 20 69 | 6e 74 65 72 72 75 70 74 |may be i|nterrupt|
|000050c0| 65 64 2c 20 73 74 6f 72 | 65 64 2c 20 61 6e 64 20 |ed, stor|ed, and |
|000050d0| 72 65 73 75 6d 65 64 20 | 61 74 0d 0a 20 20 20 20 |resumed |at.. |
|000050e0| 20 20 20 20 20 20 6c 61 | 74 65 72 20 74 69 6d 65 | la|ter time|
|000050f0| 73 20 28 67 65 6e 65 72 | 61 6c 6c 79 20 61 6e 20 |s (gener|ally an |
|00005100| 69 6d 70 6f 72 74 61 6e | 74 20 72 65 71 75 69 72 |importan|t requir|
|00005110| 65 6d 65 6e 74 20 69 6e | 0d 0a 20 20 20 20 20 20 |ement in|.. |
|00005120| 20 20 20 20 73 69 6d 75 | 6c 61 74 69 6f 6e 73 29 | simu|lations)|
|00005130| 2e 20 49 6e 20 41 64 61 | 20 69 74 20 69 73 20 63 |. In Ada| it is c|
|00005140| 6f 6e 73 69 64 65 72 65 | 64 20 69 6d 70 6f 72 74 |onsidere|d import|
|00005150| 61 6e 74 20 74 68 61 74 | 20 6d 75 6c 74 69 70 6c |ant that| multipl|
|00005160| 65 0d 0a 20 20 20 20 20 | 20 20 20 20 20 74 61 73 |e.. | tas|
|00005170| 6b 73 2c 20 65 6e 67 61 | 67 65 64 20 66 6f 72 20 |ks, enga|ged for |
|00005180| 65 78 61 6d 70 6c 65 20 | 69 6e 20 73 69 6d 75 6c |example |in simul|
|00005190| 61 74 69 6f 6e 73 2c 20 | 68 61 76 65 20 65 61 73 |ations, |have eas|
|000051a0| 79 20 61 63 63 65 73 73 | 20 74 6f 0d 0a 20 20 20 |y access| to.. |
|000051b0| 20 20 20 20 20 20 20 69 | 6e 64 65 70 65 6e 64 65 | i|ndepende|
|000051c0| 6e 74 20 73 74 72 65 61 | 6d 73 20 6f 66 20 70 73 |nt strea|ms of ps|
|000051d0| 65 75 64 6f 20 72 61 6e | 64 6f 6d 20 6e 75 6d 62 |eudo ran|dom numb|
|000051e0| 65 72 73 2e 20 54 68 65 | 20 47 6e 75 20 41 64 61 |ers. The| Gnu Ada|
|000051f0| 20 39 35 0d 0a 20 20 20 | 20 20 20 20 20 20 20 63 | 95.. | c|
|00005200| 6f 6d 70 69 6c 65 72 20 | 70 72 6f 76 69 64 65 73 |ompiler |provides|
|00005210| 20 74 68 65 20 63 72 79 | 70 74 6f 67 72 61 70 68 | the cry|ptograph|
|00005220| 69 63 61 6c 6c 79 20 73 | 65 63 75 72 65 20 58 2a |ically s|ecure X*|
|00005230| 2a 32 20 6d 6f 64 20 4e | 0d 0a 20 20 20 20 20 20 |*2 mod N|.. |
|00005240| 20 20 20 20 67 65 6e 65 | 72 61 74 6f 72 20 6f 66 | gene|rator of|
|00005250| 20 42 6c 75 6d 2c 20 42 | 6c 75 6d 20 61 6e 64 20 | Blum, B|lum and |
|00005260| 53 68 75 62 2e 0d 0a 0d | 0a 20 20 20 20 20 20 20 |Shub....|. |
|00005270| 20 20 20 28 53 65 65 20 | 73 75 62 63 6c 61 75 73 | (See |subclaus|
|00005280| 65 20 41 2e 35 2e 32 20 | 6f 66 20 74 68 65 20 41 |e A.5.2 |of the A|
|00005290| 64 61 20 39 35 20 52 65 | 66 65 72 65 6e 63 65 20 |da 95 Re|ference |
|000052a0| 4d 61 6e 75 61 6c 2c 20 | 61 6e 64 20 70 61 72 74 |Manual, |and part|
|000052b0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 49 49 49 2c |.. | III,|
|000052c0| 20 73 65 63 74 69 6f 6e | 20 41 2e 33 2e 32 20 6f | section| A.3.2 o|
|000052d0| 66 20 74 68 65 20 41 64 | 61 20 52 61 74 69 6f 6e |f the Ad|a Ration|
|000052e0| 61 6c 65 2e 29 0d 0a 0d | 0a 20 20 20 31 34 2e 20 |ale.)...|. 14. |
|000052f0| 57 65 6c 6c 2d 64 65 66 | 69 6e 65 64 20 69 6e 74 |Well-def|ined int|
|00005300| 65 72 66 61 63 65 73 20 | 74 6f 20 46 6f 72 74 72 |erfaces |to Fortr|
|00005310| 61 6e 20 61 6e 64 20 6f | 74 68 65 72 20 6c 61 6e |an and o|ther lan|
|00005320| 67 75 61 67 65 73 2e 20 | 28 41 64 61 20 38 33 0d |guages. |(Ada 83.|
|00005330| 0a 20 20 20 20 20 20 20 | 20 20 20 61 6e 64 20 41 |. | and A|
|00005340| 64 61 20 39 35 29 0d 0a | 20 20 20 20 20 20 20 20 |da 95)..| |
|00005350| 20 20 49 74 20 68 61 73 | 20 61 6c 77 61 79 73 20 | It has| always |
|00005360| 62 65 65 6e 20 61 20 62 | 61 73 69 63 20 72 65 71 |been a b|asic req|
|00005370| 75 69 72 65 6d 65 6e 74 | 20 6f 66 20 74 68 65 20 |uirement| of the |
|00005380| 6c 61 6e 67 75 61 67 65 | 20 74 68 61 74 20 69 74 |language| that it|
|00005390| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 70 72 6f 76 |.. | prov|
|000053a0| 69 64 65 20 75 73 65 72 | 73 20 61 20 77 61 79 20 |ide user|s a way |
|000053b0| 74 6f 20 69 6e 74 65 72 | 66 61 63 65 20 41 64 61 |to inter|face Ada|
|000053c0| 20 70 72 6f 67 72 61 6d | 73 20 77 69 74 68 20 66 | program|s with f|
|000053d0| 6f 72 65 69 67 6e 0d 0a | 20 20 20 20 20 20 20 20 |oreign..| |
|000053e0| 20 20 6c 61 6e 67 75 61 | 67 65 73 2c 20 6f 70 65 | langua|ges, ope|
|000053f0| 72 61 74 69 6e 67 20 73 | 79 73 74 65 6d 20 73 65 |rating s|ystem se|
|00005400| 72 76 69 63 65 73 2c 20 | 47 55 49 27 73 2c 20 65 |rvices, |GUI's, e|
|00005410| 74 63 2e 20 41 64 61 20 | 63 61 6e 20 62 65 0d 0a |tc. Ada |can be..|
|00005420| 20 20 20 20 20 20 20 20 | 20 20 76 69 65 77 65 64 | | viewed|
|00005430| 20 61 73 20 61 6e 20 69 | 6e 74 65 72 66 61 63 69 | as an i|nterfaci|
|00005440| 6e 67 20 6c 61 6e 67 75 | 61 67 65 3a 20 69 74 73 |ng langu|age: its|
|00005450| 20 6d 6f 64 75 6c 65 20 | 73 79 73 74 65 6d 20 69 | module |system i|
|00005460| 73 0d 0a 20 20 20 20 20 | 20 20 20 20 20 63 6f 6d |s.. | com|
|00005470| 70 6f 73 65 64 20 6f 66 | 20 70 61 63 6b 61 67 65 |posed of| package|
|00005480| 20 73 70 65 63 69 66 69 | 63 61 74 69 6f 6e 73 20 | specifi|cations |
|00005490| 61 6e 64 20 73 65 70 61 | 72 61 74 65 20 70 61 63 |and sepa|rate pac|
|000054a0| 6b 61 67 65 20 62 6f 64 | 69 65 73 2e 0d 0a 20 20 |kage bod|ies... |
|000054b0| 20 20 20 20 20 20 20 20 | 54 68 65 20 70 61 63 6b | |The pack|
|000054c0| 61 67 65 20 73 70 65 63 | 69 66 69 63 61 74 69 6f |age spec|ificatio|
|000054d0| 6e 73 20 63 61 6e 20 62 | 65 20 75 73 65 64 20 61 |ns can b|e used a|
|000054e0| 73 20 73 74 72 6f 6e 67 | 6c 79 2d 74 79 70 65 0d |s strong|ly-type.|
|000054f0| 0a 20 20 20 20 20 20 20 | 20 20 20 69 6e 74 65 72 |. | inter|
|00005500| 66 61 63 65 73 20 74 6f | 20 6c 69 62 72 61 72 69 |faces to| librari|
|00005510| 65 73 20 69 6d 70 6c 65 | 6d 65 6e 74 65 64 20 69 |es imple|mented i|
|00005520| 6e 20 66 6f 72 65 69 67 | 6e 20 6c 61 6e 67 75 61 |n foreig|n langua|
|00005530| 67 65 73 2c 20 61 73 0d | 0a 20 20 20 20 20 20 20 |ges, as.|. |
|00005540| 20 20 20 77 65 6c 6c 20 | 61 73 20 74 6f 20 70 61 | well |as to pa|
|00005550| 63 6b 61 67 65 20 62 6f | 64 69 65 73 20 77 72 69 |ckage bo|dies wri|
|00005560| 74 74 65 6e 20 69 6e 20 | 41 64 61 2e 20 41 64 61 |tten in |Ada. Ada|
|00005570| 20 39 35 20 65 78 74 65 | 6e 64 73 20 6f 6e 0d 0a | 95 exte|nds on..|
|00005580| 20 20 20 20 20 20 20 20 | 20 20 74 68 65 73 65 20 | | these |
|00005590| 66 61 63 69 6c 69 74 69 | 65 73 20 77 69 74 68 20 |faciliti|es with |
|000055a0| 70 61 63 6b 61 67 65 20 | 69 6e 74 65 72 66 61 63 |package |interfac|
|000055b0| 65 73 20 74 6f 20 74 68 | 65 20 62 61 73 69 63 20 |es to th|e basic |
|000055c0| 64 61 74 61 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |data.. | |
|000055d0| 73 74 72 75 63 74 75 72 | 65 73 20 6f 66 20 43 2c |structur|es of C,|
|000055e0| 20 46 6f 72 74 72 61 6e | 2c 20 61 6e 64 20 43 4f | Fortran|, and CO|
|000055f0| 42 4f 4c 20 61 6e 64 20 | 77 69 74 68 20 6e 65 77 |BOL and |with new|
|00005600| 20 70 72 61 67 6d 61 73 | 2e 20 46 6f 72 0d 0a 20 | pragmas|. For.. |
|00005610| 20 20 20 20 20 20 20 20 | 20 65 78 61 6d 70 6c 65 | | example|
|00005620| 2c 20 22 70 72 61 67 6d | 61 20 43 6f 6e 76 65 6e |, "pragm|a Conven|
|00005630| 74 69 6f 6e 28 46 6f 72 | 74 72 61 6e 2c 20 4d 29 |tion(For|tran, M)|
|00005640| 22 20 74 65 6c 6c 73 20 | 74 68 65 20 63 6f 6d 70 |" tells |the comp|
|00005650| 69 6c 65 72 20 74 6f 0d | 0a 20 20 20 20 20 20 20 |iler to.|. |
|00005660| 20 20 20 73 74 6f 72 65 | 20 74 68 65 20 65 6c 65 | store| the ele|
|00005670| 6d 65 6e 74 73 20 6f 66 | 20 6d 61 74 72 69 63 65 |ments of| matrice|
|00005680| 73 20 6f 66 20 74 79 70 | 65 20 4d 20 69 6e 20 74 |s of typ|e M in t|
|00005690| 68 65 20 46 6f 72 74 72 | 61 6e 0d 0a 20 20 20 20 |he Fortr|an.. |
|000056a0| 20 20 20 20 20 20 63 6f | 6c 75 6d 6e 2d 6d 61 6a | co|lumn-maj|
|000056b0| 6f 72 20 6f 72 64 65 72 | 2e 20 28 54 68 69 73 20 |or order|. (This |
|000056c0| 70 72 61 67 6d 61 20 68 | 61 73 20 61 6c 72 65 61 |pragma h|as alrea|
|000056d0| 64 79 20 62 65 65 6e 20 | 69 6d 70 6c 65 6d 65 6e |dy been |implemen|
|000056e0| 74 65 64 0d 0a 20 20 20 | 20 20 20 20 20 20 20 69 |ted.. | i|
|000056f0| 6e 20 74 68 65 20 47 6e | 75 20 41 64 61 20 39 35 |n the Gn|u Ada 95|
|00005700| 20 63 6f 6d 70 69 6c 65 | 72 2e 20 4d 75 6c 74 69 | compile|r. Multi|
|00005710| 2d 20 6c 69 6e 67 75 61 | 6c 20 70 72 6f 67 72 61 |- lingua|l progra|
|00005720| 6d 6d 69 6e 67 20 69 73 | 20 61 6c 73 6f 0d 0a 20 |mming is| also.. |
|00005730| 20 20 20 20 20 20 20 20 | 20 61 20 62 61 73 69 63 | | a basic|
|00005740| 20 65 6c 65 6d 65 6e 74 | 20 6f 66 20 74 68 65 20 | element| of the |
|00005750| 47 6e 75 20 63 6f 6d 70 | 69 6c 65 72 20 70 72 6f |Gnu comp|iler pro|
|00005760| 6a 65 63 74 2e 29 20 41 | 73 20 61 20 72 65 73 75 |ject.) A|s a resu|
|00005770| 6c 74 2c 0d 0a 20 20 20 | 20 20 20 20 20 20 20 61 |lt,.. | a|
|00005780| 73 73 65 6d 62 6c 79 20 | 6c 61 6e 67 75 61 67 65 |ssembly |language|
|00005790| 20 42 4c 41 53 20 61 6e | 64 20 6f 74 68 65 72 20 | BLAS an|d other |
|000057a0| 68 69 67 68 20 70 65 72 | 66 6f 72 6d 61 6e 63 65 |high per|formance|
|000057b0| 20 6c 69 6e 65 61 72 0d | 0a 20 20 20 20 20 20 20 | linear.|. |
|000057c0| 20 20 20 61 6c 67 65 62 | 72 61 20 61 6e 64 20 63 | algeb|ra and c|
|000057d0| 6f 6d 6d 75 6e 69 63 61 | 74 69 6f 6e 73 20 6c 69 |ommunica|tions li|
|000057e0| 62 72 61 72 69 65 73 20 | 77 69 6c 6c 20 62 65 20 |braries |will be |
|000057f0| 61 63 63 65 73 73 69 62 | 6c 65 20 74 6f 20 41 64 |accessib|le to Ad|
|00005800| 61 0d 0a 20 20 20 20 20 | 20 20 20 20 20 70 72 6f |a.. | pro|
|00005810| 67 72 61 6d 73 2e 0d 0a | 0d 0a 20 20 20 20 20 20 |grams...|.. |
|00005820| 20 20 20 20 28 53 65 65 | 20 41 64 61 20 39 35 20 | (See| Ada 95 |
|00005830| 52 65 66 65 72 65 6e 63 | 65 20 4d 61 6e 75 61 6c |Referenc|e Manual|
|00005840| 3a 20 63 6c 61 75 73 65 | 20 42 2e 31 20 61 6e 64 |: clause| B.1 and|
|00005850| 20 42 2e 35 20 6f 66 20 | 41 6e 6e 65 78 20 42 2c | B.5 of |Annex B,|
|00005860| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 61 6e 64 20 |.. | and |
|00005870| 41 64 61 20 39 35 20 52 | 61 74 69 6f 6e 61 6c 65 |Ada 95 R|ationale|
|00005880| 3a 20 50 61 72 74 20 49 | 49 49 20 42 2e 29 0d 0a |: Part I|II B.)..|
|00005890| 0d 0a 0d 0a 36 2e 34 3a | 20 48 6f 77 20 64 6f 20 |....6.4:| How do |
|000058a0| 49 20 67 65 74 20 52 65 | 61 6c 20 76 61 6c 75 65 |I get Re|al value|
|000058b0| 64 20 61 6e 64 20 43 6f | 6d 70 6c 65 78 20 76 61 |d and Co|mplex va|
|000058c0| 6c 75 65 64 20 6d 61 74 | 68 20 66 75 6e 63 74 69 |lued mat|h functi|
|000058d0| 6f 6e 73 20 69 6e 20 41 | 64 61 20 39 35 3f 0d 0a |ons in A|da 95?..|
|000058e0| 0d 0a 20 20 20 28 66 72 | 6f 6d 20 4a 6f 6e 61 74 |.. (fr|om Jonat|
|000058f0| 68 61 6e 20 50 61 72 6b | 65 72 29 0d 0a 0d 0a 20 |han Park|er).... |
|00005900| 20 20 43 6f 6d 70 6c 65 | 78 20 74 79 70 65 20 61 | Comple|x type a|
|00005910| 6e 64 20 66 75 6e 63 74 | 69 6f 6e 73 20 61 72 65 |nd funct|ions are|
|00005920| 20 70 72 6f 76 69 64 65 | 64 20 62 79 20 63 6f 6d | provide|d by com|
|00005930| 70 69 6c 65 72 73 20 74 | 68 61 74 20 73 75 70 70 |pilers t|hat supp|
|00005940| 6f 72 74 20 74 68 65 0d | 0a 20 20 20 6e 75 6d 65 |ort the.|. nume|
|00005950| 72 69 63 73 20 41 6e 6e | 65 78 2e 20 54 68 65 20 |rics Ann|ex. The |
|00005960| 70 61 63 6b 61 67 65 73 | 20 74 68 61 74 20 75 73 |packages| that us|
|00005970| 65 20 46 6c 6f 61 74 20 | 66 6f 72 20 74 68 65 20 |e Float |for the |
|00005980| 52 65 61 6c 20 6e 75 6d | 62 65 72 20 61 6e 64 0d |Real num|ber and.|
|00005990| 0a 20 20 20 66 6f 72 20 | 74 68 65 20 43 6f 6d 70 |. for |the Comp|
|000059a0| 6c 65 78 20 6e 75 6d 62 | 65 72 20 61 72 65 3a 0d |lex numb|er are:.|
|000059b0| 0a 0d 0a 20 20 20 20 20 | 41 64 61 2e 4e 75 6d 65 |... |Ada.Nume|
|000059c0| 72 69 63 73 2e 45 6c 65 | 6d 65 6e 74 61 72 79 5f |rics.Ele|mentary_|
|000059d0| 46 75 6e 63 74 69 6f 6e | 73 3b 0d 0a 20 20 20 20 |Function|s;.. |
|000059e0| 20 41 64 61 2e 4e 75 6d | 65 72 69 63 73 2e 43 6f | Ada.Num|erics.Co|
|000059f0| 6d 70 6c 65 78 5f 54 79 | 70 65 73 3b 0d 0a 20 20 |mplex_Ty|pes;.. |
|00005a00| 20 20 20 41 64 61 2e 4e | 75 6d 65 72 69 63 73 2e | Ada.N|umerics.|
|00005a10| 43 6f 6d 70 6c 65 78 5f | 45 6c 65 6d 65 6e 74 61 |Complex_|Elementa|
|00005a20| 72 79 5f 46 75 6e 63 74 | 69 6f 6e 73 3b 0d 0a 0d |ry_Funct|ions;...|
|00005a30| 0a 0d 0a 20 20 20 54 68 | 65 20 70 61 63 6b 61 67 |... Th|e packag|
|00005a40| 65 73 20 74 68 61 74 20 | 75 73 65 20 4c 6f 6e 67 |es that |use Long|
|00005a50| 5f 46 6c 6f 61 74 20 66 | 6f 72 20 74 68 65 20 52 |_Float f|or the R|
|00005a60| 65 61 6c 20 6e 75 6d 62 | 65 72 20 61 6e 64 20 66 |eal numb|er and f|
|00005a70| 6f 72 20 74 68 65 0d 0a | 20 20 20 43 6f 6d 70 6c |or the..| Compl|
|00005a80| 65 78 20 6e 75 6d 62 65 | 72 20 61 72 65 3a 0d 0a |ex numbe|r are:..|
|00005a90| 0d 0a 20 20 20 20 20 41 | 64 61 2e 4e 75 6d 65 72 |.. A|da.Numer|
|00005aa0| 69 63 73 2e 4c 6f 6e 67 | 5f 45 6c 65 6d 65 6e 74 |ics.Long|_Element|
|00005ab0| 61 72 79 5f 46 75 6e 63 | 74 69 6f 6e 73 3b 0d 0a |ary_Func|tions;..|
|00005ac0| 20 20 20 20 20 41 64 61 | 2e 4e 75 6d 65 72 69 63 | Ada|.Numeric|
|00005ad0| 73 2e 4c 6f 6e 67 5f 43 | 6f 6d 70 6c 65 78 5f 54 |s.Long_C|omplex_T|
|00005ae0| 79 70 65 73 3b 0d 0a 20 | 20 20 20 20 41 64 61 2e |ypes;.. | Ada.|
|00005af0| 4e 75 6d 65 72 69 63 73 | 2e 4c 6f 6e 67 5f 43 6f |Numerics|.Long_Co|
|00005b00| 6d 70 6c 65 78 5f 45 6c | 65 6d 65 6e 74 61 72 79 |mplex_El|ementary|
|00005b10| 5f 46 75 6e 63 74 69 6f | 6e 73 3b 0d 0a 0d 0a 0d |_Functio|ns;.....|
|00005b20| 0a 20 20 20 54 68 65 20 | 67 65 6e 65 72 69 63 20 |. The |generic |
|00005b30| 76 65 72 73 69 6f 6e 73 | 20 61 72 65 20 64 65 6d |versions| are dem|
|00005b40| 6f 6e 73 74 72 61 74 65 | 64 20 69 6e 20 74 68 65 |onstrate|d in the|
|00005b50| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 65 78 61 6d 70 | followi|ng examp|
|00005b60| 6c 65 2e 20 4b 65 65 70 | 0d 0a 20 20 20 69 6e 20 |le. Keep|.. in |
|00005b70| 6d 69 6e 64 20 74 68 61 | 74 20 74 68 65 20 6e 6f |mind tha|t the no|
|00005b80| 6e 2d 67 65 6e 65 72 69 | 63 20 70 61 63 6b 61 67 |n-generi|c packag|
|00005b90| 65 73 20 6d 61 79 20 68 | 61 76 65 20 62 65 65 6e |es may h|ave been|
|00005ba0| 20 62 65 74 74 65 72 20 | 74 75 6e 65 64 20 66 6f | better |tuned fo|
|00005bb0| 72 0d 0a 20 20 20 73 70 | 65 65 64 20 6f 72 20 61 |r.. sp|eed or a|
|00005bc0| 63 63 75 72 61 63 79 2e | 20 49 6e 20 70 72 61 63 |ccuracy.| In prac|
|00005bd0| 74 69 63 65 20 79 6f 75 | 20 77 6f 6e 27 74 20 61 |tice you| won't a|
|00005be0| 6c 77 61 79 73 20 69 6e | 73 74 61 6e 74 69 61 74 |lways in|stantiat|
|00005bf0| 65 20 61 6c 6c 20 74 68 | 72 65 65 0d 0a 20 20 20 |e all th|ree.. |
|00005c00| 70 61 63 6b 61 67 65 73 | 20 61 74 20 74 68 65 20 |packages| at the |
|00005c10| 73 61 6d 65 20 74 69 6d | 65 2c 20 62 75 74 20 68 |same tim|e, but h|
|00005c20| 65 72 65 20 69 73 20 68 | 6f 77 20 79 6f 75 20 64 |ere is h|ow you d|
|00005c30| 6f 20 69 74 3a 0d 0a 0d | 0a 20 20 20 20 20 77 69 |o it:...|. wi|
|00005c40| 74 68 20 41 64 61 2e 4e | 75 6d 65 72 69 63 73 2e |th Ada.N|umerics.|
|00005c50| 47 65 6e 65 72 69 63 5f | 43 6f 6d 70 6c 65 78 5f |Generic_|Complex_|
|00005c60| 54 79 70 65 73 3b 0d 0a | 20 20 20 20 20 77 69 74 |Types;..| wit|
|00005c70| 68 20 41 64 61 2e 4e 75 | 6d 65 72 69 63 73 2e 47 |h Ada.Nu|merics.G|
|00005c80| 65 6e 65 72 69 63 5f 45 | 6c 65 6d 65 6e 74 61 72 |eneric_E|lementar|
|00005c90| 79 5f 46 75 6e 63 74 69 | 6f 6e 73 3b 0d 0a 20 20 |y_Functi|ons;.. |
|00005ca0| 20 20 20 77 69 74 68 20 | 41 64 61 2e 4e 75 6d 65 | with |Ada.Nume|
|00005cb0| 72 69 63 73 2e 47 65 6e | 65 72 69 63 5f 43 6f 6d |rics.Gen|eric_Com|
|00005cc0| 70 6c 65 78 5f 45 6c 65 | 6d 65 6e 74 61 72 79 5f |plex_Ele|mentary_|
|00005cd0| 46 75 6e 63 74 69 6f 6e | 73 3b 0d 0a 0d 0a 20 20 |Function|s;.... |
|00005ce0| 20 20 20 70 72 6f 63 65 | 64 75 72 65 20 44 6f 5f | proce|dure Do_|
|00005cf0| 53 6f 6d 65 74 68 69 6e | 67 5f 4e 75 6d 65 72 69 |Somethin|g_Numeri|
|00005d00| 63 61 6c 20 69 73 0d 0a | 0d 0a 20 20 20 20 20 20 |cal is..|.. |
|00005d10| 20 74 79 70 65 20 52 65 | 61 6c 5f 38 20 69 73 20 | type Re|al_8 is |
|00005d20| 64 69 67 69 74 73 20 31 | 35 3b 0d 0a 0d 0a 20 20 |digits 1|5;.... |
|00005d30| 20 20 20 20 20 70 61 63 | 6b 61 67 65 20 52 65 61 | pac|kage Rea|
|00005d40| 6c 5f 46 75 6e 63 74 69 | 6f 6e 73 5f 38 20 69 73 |l_Functi|ons_8 is|
|00005d50| 0d 0a 20 20 20 20 20 20 | 20 20 20 6e 65 77 20 41 |.. | new A|
|00005d60| 64 61 2e 4e 75 6d 65 72 | 69 63 73 2e 47 65 6e 65 |da.Numer|ics.Gene|
|00005d70| 72 69 63 5f 45 6c 65 6d | 65 6e 74 61 72 79 5f 46 |ric_Elem|entary_F|
|00005d80| 75 6e 63 74 69 6f 6e 73 | 20 28 52 65 61 6c 5f 38 |unctions| (Real_8|
|00005d90| 29 3b 0d 0a 0d 0a 20 20 | 20 20 20 20 20 70 61 63 |);.... | pac|
|00005da0| 6b 61 67 65 20 43 6f 6d | 70 6c 65 78 5f 4e 75 6d |kage Com|plex_Num|
|00005db0| 73 5f 38 20 69 73 0d 0a | 20 20 20 20 20 20 20 20 |s_8 is..| |
|00005dc0| 20 6e 65 77 20 41 64 61 | 2e 4e 75 6d 65 72 69 63 | new Ada|.Numeric|
|00005dd0| 73 2e 47 65 6e 65 72 69 | 63 5f 43 6f 6d 70 6c 65 |s.Generi|c_Comple|
|00005de0| 78 5f 54 79 70 65 73 20 | 28 52 65 61 6c 5f 38 29 |x_Types |(Real_8)|
|00005df0| 3b 0d 0a 0d 0a 20 20 20 | 20 20 20 20 70 61 63 6b |;.... | pack|
|00005e00| 61 67 65 20 43 6f 6d 70 | 6c 65 78 5f 46 75 6e 63 |age Comp|lex_Func|
|00005e10| 74 69 6f 6e 73 5f 38 20 | 69 73 0d 0a 20 20 20 20 |tions_8 |is.. |
|00005e20| 20 20 20 20 20 6e 65 77 | 20 41 64 61 2e 4e 75 6d | new| Ada.Num|
|00005e30| 65 72 69 63 73 2e 47 65 | 6e 65 72 69 63 5f 43 6f |erics.Ge|neric_Co|
|00005e40| 6d 70 6c 65 78 5f 45 6c | 65 6d 65 6e 74 61 72 79 |mplex_El|ementary|
|00005e50| 5f 46 75 6e 63 74 69 6f | 6e 73 0d 0a 20 20 20 20 |_Functio|ns.. |
|00005e60| 20 20 20 20 20 20 20 28 | 43 6f 6d 70 6c 65 78 5f | (|Complex_|
|00005e70| 4e 75 6d 73 5f 38 29 3b | 0d 0a 0d 0a 20 20 20 20 |Nums_8);|.... |
|00005e80| 20 20 20 75 73 65 20 52 | 65 61 6c 5f 46 75 6e 63 | use R|eal_Func|
|00005e90| 74 69 6f 6e 73 5f 38 2c | 20 43 6f 6d 70 6c 65 78 |tions_8,| Complex|
|00005ea0| 5f 4e 75 6d 73 5f 38 2c | 20 43 6f 6d 70 6c 65 78 |_Nums_8,| Complex|
|00005eb0| 5f 46 75 6e 63 74 69 6f | 6e 73 5f 38 3b 0d 0a 20 |_Functio|ns_8;.. |
|00005ec0| 20 20 20 20 20 20 2e 2e | 2e 0d 0a 20 20 20 20 20 | ..|... |
|00005ed0| 20 20 2e 2e 2e 20 2d 2d | 20 44 6f 20 73 6f 6d 65 | ... --| Do some|
|00005ee0| 74 68 69 6e 67 0d 0a 20 | 20 20 20 20 20 20 2e 2e |thing.. | ..|
|00005ef0| 2e 0d 0a 20 20 20 20 20 | 65 6e 64 20 44 6f 5f 53 |... |end Do_S|
|00005f00| 6f 6d 65 74 68 69 6e 67 | 5f 4e 75 6d 65 72 69 63 |omething|_Numeric|
|00005f10| 61 6c 3b 0d 0a 0d 0a 0d | 0a 36 2e 35 3a 20 57 68 |al;.....|.6.5: Wh|
|00005f20| 61 74 20 6c 69 62 72 61 | 72 69 65 73 20 6f 72 20 |at libra|ries or |
|00005f30| 70 75 62 6c 69 63 20 61 | 6c 67 6f 72 69 74 68 6d |public a|lgorithm|
|00005f40| 73 20 65 78 69 73 74 20 | 66 6f 72 20 41 64 61 3f |s exist |for Ada?|
|00005f50| 0d 0a 0d 0a 20 20 20 41 | 6e 20 41 64 61 20 76 65 |.... A|n Ada ve|
|00005f60| 72 73 69 6f 6e 20 6f 66 | 20 46 61 73 74 20 46 6f |rsion of| Fast Fo|
|00005f70| 75 72 69 65 72 20 54 72 | 61 6e 73 66 6f 72 6d 20 |urier Tr|ansform |
|00005f80| 69 73 20 61 76 61 69 6c | 61 62 6c 65 2e 20 49 74 |is avail|able. It|
|00005f90| 27 73 20 69 6e 0d 0a 20 | 20 20 6a 6f 75 72 6e 61 |'s in.. | journa|
|00005fa0| 6c 20 22 43 6f 6d 70 75 | 74 65 72 73 20 26 20 4d |l "Compu|ters & M|
|00005fb0| 61 74 68 65 6d 61 74 69 | 63 73 20 77 69 74 68 20 |athemati|cs with |
|00005fc0| 41 70 70 6c 69 63 61 74 | 69 6f 6e 73 2c 22 20 76 |Applicat|ions," v|
|00005fd0| 6f 6c 2e 20 32 36 2c 20 | 6e 6f 2e 20 32 2c 0d 0a |ol. 26, |no. 2,..|
|00005fe0| 20 20 20 70 70 2e 20 36 | 31 2d 36 35 2c 20 31 39 | pp. 6|1-65, 19|
|00005ff0| 39 33 2c 20 77 69 74 68 | 20 74 68 65 20 74 69 74 |93, with| the tit|
|00006000| 6c 65 3a 0d 0a 0d 0a 20 | 20 20 22 41 6e 61 6c 79 |le:.... | "Analy|
|00006010| 73 69 73 20 6f 66 20 61 | 6e 20 41 64 61 20 42 61 |sis of a|n Ada Ba|
|00006020| 73 65 64 20 56 65 72 73 | 69 6f 6e 20 6f 66 20 47 |sed Vers|ion of G|
|00006030| 6c 61 73 73 6d 61 6e 27 | 73 20 47 65 6e 65 72 61 |lassman'|s Genera|
|00006040| 6c 20 4e 20 50 6f 69 6e | 74 20 46 61 73 74 0d 0a |l N Poin|t Fast..|
|00006050| 20 20 20 46 6f 75 72 69 | 65 72 20 54 72 61 6e 73 | Fouri|er Trans|
|00006060| 66 6f 72 6d 22 0d 0a 0d | 0a 20 20 20 54 68 65 20 |form"...|. The |
|00006070| 70 61 63 6b 61 67 65 20 | 69 73 20 6e 6f 77 20 61 |package |is now a|
|00006080| 76 61 69 6c 61 62 6c 65 | 20 69 6e 20 74 68 65 20 |vailable| in the |
|00006090| 41 64 61 4e 45 54 20 72 | 65 70 6f 73 69 74 6f 72 |AdaNET r|epositor|
|000060a0| 79 2c 20 6f 62 6a 65 63 | 74 20 23 3a 20 36 37 32 |y, objec|t #: 672|
|000060b0| 38 2c 0d 0a 20 20 20 69 | 6e 20 63 6f 6c 6c 65 63 |8,.. i|n collec|
|000060c0| 74 69 6f 6e 3a 20 54 72 | 61 6e 73 66 6f 72 6d 73 |tion: Tr|ansforms|
|000060d0| 2e 20 49 66 20 79 6f 75 | 27 72 65 20 6e 6f 74 20 |. If you|'re not |
|000060e0| 61 6e 20 41 64 61 4e 45 | 54 20 75 73 65 72 2c 20 |an AdaNE|T user, |
|000060f0| 63 6f 6e 74 61 63 74 20 | 50 65 67 67 79 0d 0a 20 |contact |Peggy.. |
|00006100| 20 20 4c 61 63 65 79 20 | 28 6c 61 63 65 79 40 72 | Lacey |(lacey@r|
|00006110| 62 73 65 2e 6d 6f 75 6e | 74 61 69 6e 2e 6e 65 74 |bse.moun|tain.net|
|00006120| 29 2e 0d 0a 0d 0a 20 20 | 20 20 20 5f 5f 5f 5f 5f |)..... | _____|
|00006130| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00006140| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00006150| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00006160| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 0d 0a 0d 0a |________|____....|
|00006170| 0d 0a 37 3a 20 45 66 66 | 69 63 69 65 6e 63 79 20 |..7: Eff|iciency |
|00006180| 6f 66 20 41 64 61 20 43 | 6f 6e 73 74 72 75 63 74 |of Ada C|onstruct|
|00006190| 73 0d 0a 0d 0a 0d 0a 37 | 2e 31 3a 20 48 6f 77 20 |s......7|.1: How |
|000061a0| 6d 75 63 68 20 65 78 74 | 72 61 20 6f 76 65 72 68 |much ext|ra overh|
|000061b0| 65 61 64 20 64 6f 20 67 | 65 6e 65 72 69 63 73 20 |ead do g|enerics |
|000061c0| 68 61 76 65 3f 0d 0a 0d | 0a 20 20 20 49 66 20 79 |have?...|. If y|
|000061d0| 6f 75 20 6f 76 65 72 67 | 65 6e 65 72 61 6c 69 7a |ou overg|eneraliz|
|000061e0| 65 20 74 68 65 20 67 65 | 6e 65 72 69 63 2c 20 74 |e the ge|neric, t|
|000061f0| 68 65 72 65 20 77 69 6c | 6c 20 62 65 20 6d 6f 72 |here wil|l be mor|
|00006200| 65 20 77 6f 72 6b 20 74 | 6f 20 64 6f 20 66 6f 72 |e work t|o do for|
|00006210| 0d 0a 20 20 20 74 68 65 | 20 63 6f 6d 70 69 6c 65 |.. the| compile|
|00006220| 72 2e 20 48 6f 77 20 64 | 6f 20 79 6f 75 20 6b 6e |r. How d|o you kn|
|00006230| 6f 77 20 77 68 65 6e 20 | 79 6f 75 20 68 61 76 65 |ow when |you have|
|00006240| 20 6f 76 65 72 67 65 6e | 65 72 61 6c 69 7a 65 64 | overgen|eralized|
|00006250| 3f 20 46 6f 72 0d 0a 20 | 20 20 69 6e 73 74 61 6e |? For.. | instan|
|00006260| 63 65 2c 20 70 61 73 73 | 69 6e 67 20 61 72 69 74 |ce, pass|ing arit|
|00006270| 68 6d 65 74 69 63 20 6f | 70 65 72 61 74 69 6f 6e |hmetic o|peration|
|00006280| 73 20 61 73 20 70 61 72 | 61 6d 65 74 65 72 73 20 |s as par|ameters |
|00006290| 69 73 20 61 20 62 61 64 | 20 73 69 67 6e 2e 0d 0a |is a bad| sign...|
|000062a0| 20 20 20 53 6f 20 61 72 | 65 20 62 6f 6f 6c 65 61 | So ar|e boolea|
|000062b0| 6e 20 6f 72 20 65 6e 75 | 6d 65 72 61 74 69 6f 6e |n or enu|meration|
|000062c0| 20 74 79 70 65 20 67 65 | 6e 65 72 69 63 20 66 6f | type ge|neric fo|
|000062d0| 72 6d 61 6c 20 70 61 72 | 61 6d 65 74 65 72 73 2e |rmal par|ameters.|
|000062e0| 20 49 66 20 79 6f 75 0d | 0a 20 20 20 6e 65 76 65 | If you.|. neve|
|000062f0| 72 20 6f 76 65 72 72 69 | 64 65 20 74 68 65 20 64 |r overri|de the d|
|00006300| 65 66 61 75 6c 74 73 20 | 66 6f 72 20 61 20 70 61 |efaults |for a pa|
|00006310| 72 61 6d 65 74 65 72 2c | 20 79 6f 75 20 70 72 6f |rameter,| you pro|
|00006320| 62 61 62 6c 79 0d 0a 20 | 20 20 6f 76 65 72 65 6e |bably.. | overen|
|00006330| 67 69 6e 65 65 72 65 64 | 2e 0d 0a 0d 0a 20 20 20 |gineered|..... |
|00006340| 43 6f 64 65 20 73 68 61 | 72 69 6e 67 20 28 69 66 |Code sha|ring (if|
|00006350| 20 69 6d 70 6c 65 6d 65 | 6e 74 65 64 20 61 6e 64 | impleme|nted and|
|00006360| 20 72 65 71 75 65 73 74 | 65 64 29 20 77 69 6c 6c | request|ed) will|
|00006370| 20 63 61 75 73 65 20 61 | 6e 20 61 64 64 69 74 69 | cause a|n additi|
|00006380| 6f 6e 61 6c 0d 0a 20 20 | 20 6f 76 65 72 68 65 61 |onal.. | overhea|
|00006390| 64 20 6f 6e 20 73 6f 6d | 65 20 63 61 6c 6c 73 2c |d on som|e calls,|
|000063a0| 20 77 68 69 63 68 20 77 | 69 6c 6c 20 62 65 20 70 | which w|ill be p|
|000063b0| 61 72 74 69 61 6c 6c 79 | 20 6f 66 66 73 65 74 20 |artially| offset |
|000063c0| 62 79 20 69 6d 70 72 6f | 76 65 64 0d 0a 20 20 20 |by impro|ved.. |
|000063d0| 6c 6f 63 61 6c 69 74 79 | 20 6f 66 20 72 65 66 65 |locality| of refe|
|000063e0| 72 65 6e 63 65 2e 20 28 | 54 72 61 6e 73 6c 61 74 |rence. (|Translat|
|000063f0| 69 6f 6e 2c 20 63 6f 64 | 65 20 73 68 61 72 69 6e |ion, cod|e sharin|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.