home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!paladin.american.edu!gatech!news.ans.net!cmcl2!adm!news
- From: ISAACSON@husc3.harvard.edu
- Newsgroups: comp.lang.pascal
- Subject: Re: complex numbers
- Message-ID: <34963@adm.brl.mil>
- Date: 12 Jan 93 10:37:22 GMT
- Sender: news@adm.brl.mil
- Lines: 28
-
- Well, I'm new to this mail program I'm using, so I can't quote
- you, and I'm new to this list (your message was in my first group
- received) so I probably couldn't quote you accurately anyway.
- However, I remember you saying that you want some kind of
- "exponentiation operator" for Pascal. Well, the only operator of
- this type that I know of is referenced mathematically as the caret
- "^" -- raising something to a power, or exponent? I wrote a very
- simple function in Pascal to do this, although because the subject
- line is "complex numbers" I doubt it will help too much. Here it
- is anyway:
-
- function power(base, exp : word) : word;
- var
- count, temp : word;
- begin
- temp := 1;
- if exp > 0 then
- for count := 1 to exp do
- temp := temp * base;
- power := temp;
- end;
-
- This one is implemented using words, just because that's what the
- program I used it in called for. I do have a fair amount of
- experience with things like this, so let me know if I can help
- more...
-
- - Ron Isaacson
-