From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aceef612e0190367 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-20 15:02:05 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!193.190.198.17!newsfeeds.belnet.be!news.belnet.be!btnet-peer1!btnet-peer0!btnet!news5-gui.server.ntli.net!ntli.net!news2-win.server.ntlworld.com.POSTED!not-for-mail From: "chris.danx" Newsgroups: comp.lang.ada References: <998i7d$19j21@tech.port.ac.uk> Subject: Re: Integer? float? confused... X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Tue, 20 Mar 2001 22:55:42 -0000 NNTP-Posting-Host: 213.104.120.177 X-Complaints-To: abuse@ntlworld.com X-Trace: news2-win.server.ntlworld.com 985128940 213.104.120.177 (Tue, 20 Mar 2001 22:55:40 GMT) NNTP-Posting-Date: Tue, 20 Mar 2001 22:55:40 GMT Organization: ntlworld News Service Xref: supernews.google.com comp.lang.ada:5941 Date: 2001-03-20T22:55:42+00:00 List-Id: You need to use 3.0, 6.0, 5.0 and 120.0 in function Calc_Sin. This is because Ada requires a float to have decimal point in it somewhere. If you don't include the .0 Ada thinks it's an integer. Also convert the Num to a float by Float(Num) otherwise Ada thinks Num is an integer -- which it is! but your can't mix types so you've got to convert. May i make a suggestion? It would be better to have function Calc_Sin (Num : integer) return float is begin return Num - (Num ** 3) / 6 + (Num ** 5) / 120; end Calc_Sin instead of using sin_result. This variable is global and in other programs you might do something similar and it'll screw everything up. You could move the declaration of Sin_Result inside the function and what you've written would work if you fixed the type conversion problem. I haven't fixed it in the above function cos' that's for you to do. Hope this helps, Chris Campbell p.s. let me know *when* you get it working, or if anythings not clear -- i'm terrible at explaining things to people.