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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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-22 23:13:17 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!212.74.64.35!colt.net!newspeer.highwayone.net!newsfeed1.telenordia.se!algonet!uab.ericsson.se!erinews.ericsson.se!news.emw.ericsson.se!not-for-mail Message-ID: <3ABAF62B.29D79A22@emw.ericsson.se> From: Sven Nilsson Reply-To: sven.nilsson@emw.ericsson.se Organization: Ericsson Microwave Systems AB X-Mailer: Mozilla 4.75C-EMW [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Integer? float? confused... References: <99eg1q$19j27@tech.port.ac.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 23 Mar 2001 08:07:23 +0100 NNTP-Posting-Host: 136.225.182.69 X-Trace: news.emw.ericsson.se 985331243 136.225.182.69 (Fri, 23 Mar 2001 08:07:23 MET) NNTP-Posting-Date: Fri, 23 Mar 2001 08:07:23 MET Xref: supernews.google.com comp.lang.ada:6017 Date: 2001-03-23T08:07:23+01:00 List-Id: The problem is the line Sin_Result := Num - (Num ** 3) / 6 + (Num ** 5) / 120; where you have a lot of integer arithmetic and expect a float in the end. If you write it like this: Sin_Result := float(Num) - float(Num ** 3.0) / 6.0 + float(Num ** 5)/120.0; That should work. Now we've upcasted all the integers to floats and perform only float arithmetic, which means that the end result is a float as well. -Sven