comp.lang.ada
 help / color / mirror / Atom feed
* Exponent floats?
@ 2005-03-28  4:49 Puckdropper
  2005-03-28  6:39 ` tmoran
  2005-03-28  6:49 ` Dmitry A. Kazakov
  0 siblings, 2 replies; 11+ messages in thread
From: Puckdropper @ 2005-03-28  4:49 UTC (permalink / raw)


I have an algorithm that requires a floating point exponent.  How can I 
use such a thing?  I tried using **, but it gives me 3 errors:

test.adb:12:24: invalid operand types for operator "**"
test.adb:12:24: left operand has type "Standard.float"
test.adb:12:24: right operand has type "Standard.float"

To demonstrate my problem, I wrote a short program:

-----------------------------

with Ada.Text_IO, Ada.Float_Text_IO;

procedure test is

expon: float;
Answer: float;
Base: float;

begin -- Main Program
	expon := 2.0;
	Base := 2.0;
	Answer := base ** expon;
	Ada.Float_Text_IO.put(Answer);
	Ada.Text_IO.new_line;
end test;

------------------------------

Thanks,

Puckdropper
-- 
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we 
still enjoy using the old computers. Sometimes we want to see how far a 
particular system can go, other times we use a stock system to remind 
ourselves of what we once had.

To email me directly, send a message to puckdropper (at) fastmail.fm



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

end of thread, other threads:[~2005-03-29 18:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-28  4:49 Exponent floats? Puckdropper
2005-03-28  6:39 ` tmoran
2005-03-28  6:49 ` Dmitry A. Kazakov
2005-03-28  8:49   ` Pascal Obry
2005-03-28  9:57     ` Dmitry A. Kazakov
2005-03-28 17:47       ` Puckdropper
2005-03-28 18:34         ` Pascal Obry
2005-03-28 22:27           ` Puckdropper
2005-03-28 18:51         ` Dmitry A. Kazakov
2005-03-29  9:29           ` Martin Krischik
2005-03-29 18:55             ` Manuel G. R.

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