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,FREEMAIL_FROM,XPRIO autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aceef612e0190367,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-20 14:12:22 PST From: "WM" Newsgroups: comp.lang.ada Subject: Integer? float? confused... Date: Tue, 20 Mar 2001 21:31:27 -0000 Organization: University of Portsmouth Message-ID: <998i7d$19j21@tech.port.ac.uk> NNTP-Posting-Host: node2-145.remote.port.ac.uk X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Path: supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!news.tele.dk!212.74.64.35!colt.net!newspeer.clara.net!news.clara.net!server3.netnews.ja.net!news-spool.soton.ac.uk!news.ecs.soton.ac.uk!news.port.ac.uk!news Xref: supernews.google.com comp.lang.ada:5933 Date: 2001-03-20T21:31:27+00:00 List-Id: I have written a program to calculate Sin. The compiler(AdaGIDE 6.23) said: "expected type standard.float", why? Please piont out errors, Thanks. with Ada.Text_Io, Ada.Integer_Text_Io,Ada.Float_Text_Io; use Ada.Text_Io, Ada.Integer_Text_Io,Ada.Float_Text_Io; procedure sin is sin_result : float; i : integer; function Calc_Sin (Num : Integer) return float is begin Sin_Result := Num - (Num ** 3) / 6 + (Num ** 5) / 120; return Sin_Result; end Calc_Sin; begin put("input int: "); get(i); Sin_Result := Calc_Sin(Num=>i); Put(Item=>Sin_Result, Fore=>1, Aft=>4, Exp=>0); end sin;