comp.lang.ada
 help / color / mirror / Atom feed
* Integer? float? confused...
@ 2001-03-20 21:31 WM
  2001-03-23  7:07 ` Sven Nilsson
  0 siblings, 1 reply; 9+ messages in thread
From: WM @ 2001-03-20 21:31 UTC (permalink / raw)


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;





^ permalink raw reply	[flat|nested] 9+ messages in thread
* Integer? float? confused...
@ 2001-03-20 21:31 WM
  2001-03-20 22:55 ` chris.danx
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: WM @ 2001-03-20 21:31 UTC (permalink / raw)


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;





^ permalink raw reply	[flat|nested] 9+ messages in thread
* Integer? float? confused...
@ 2001-03-20 21:31 WM
  2001-04-05 18:30 ` mark
  0 siblings, 1 reply; 9+ messages in thread
From: WM @ 2001-03-20 21:31 UTC (permalink / raw)


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;





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-04-05 18:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-20 21:31 Integer? float? confused WM
2001-03-23  7:07 ` Sven Nilsson
  -- strict thread matches above, loose matches on Subject: below --
2001-03-20 21:31 WM
2001-03-20 22:55 ` chris.danx
2001-03-20 22:59 ` EtienneB
2001-03-21  1:32 ` Ken Garlington
2001-03-23 12:08 ` dis00109
2001-03-20 21:31 WM
2001-04-05 18:30 ` mark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox