Complex number arithmetic in Delphi 2010

Hi,

In Delphi 2010, is it possible to overload the operators "+", "-", "*" and "/" in order to be able to perform arithmetic on complex numbers (which have a real and imaginary part)? If so, can anyone point me to some examples of how this can be done.

Thanks.
0
Witold
1/26/2010 9:50:44 PM
embarcadero.delphi.general 4258 articles. 0 followers. Follow

6 Replies
872 Views

Similar Articles

[PageSpeed] 53

Witold Waldman wrote:

> In Delphi 2010, is it possible to overload the operators "+", "-",
> "*" and "/" in order to be able to perform arithmetic on complex
> numbers (which have a real and imaginary part)? If so, can anyone
> point me to some examples of how this can be done.

Perhaps the ComplexNumbers sample application that comes with 2010
would be helpful to you.

-- 
-Mike (TeamB)
0
Mike
1/26/2010 9:58:54 PM
> {quote:title=Mike Williams (TeamB) wrote:}{quote}
> Perhaps the ComplexNumbers sample application that comes with 2010
> would be helpful to you.

Hi Mike,

Where would I find the ComplexNumbers sample application? I've had a look through the various Delphi 2010 folders, but I couldn't find anything that seemed related to complex numbers. Please note that I'm using the Delphi 2010 trial at this point in time.

Cheers,

Witold
0
Witold
1/26/2010 10:40:45 PM
Witold Waldman wrote:

> > {quote:title=Mike Williams (TeamB) wrote:}{quote}
> > Perhaps the ComplexNumbers sample application that comes with 2010
> > would be helpful to you.
> 
> Hi Mike,
> 
> Where would I find the ComplexNumbers sample application? I've had a
> look through the various Delphi 2010 folders, but I couldn't find
> anything that seemed related to complex numbers. 

It is in the demo folder, which is usually not stored together with the
Delphi folders. I'm not quite sure where it normally is, since I stored
it in a non-default directory, but just search for a folder called
<whatever it is>\Demos\DelphiWin32\VCLWin32\ComplexNumbers.
-- 
Rudy Velthuis (TeamB)        http://www.teamb.com

Hubbard's Law: Don't take life too seriously; you won't get out 
of it alive.
0
Rudy
1/27/2010 12:08:12 AM
> {quote:title=Rudy Velthuis (TeamB) wrote:}{quote}
> It is in the demo folder, which is usually not stored together with the Delphi folders. I'm not quite sure where it normally is, since I stored it in a non-default directory, but just search for a folder called <whatever it is>\Demos\DelphiWin32\VCLWin32\ComplexNumbers.

Rudy,

Many thanks. I found it in the C:\Documents and Settings\All Users\Documents\RAD Studio\7.0\Demos\DelphiWin32\VCLWin32\ComplexNumbers folder.

---
Witold

Edited by: Witold Waldman on Jan 26, 2010 4:47 PM
0
Witold
1/27/2010 12:47:37 AM
<Witold Waldman> wrote
> In Delphi 2010, is it possible to overload the operators "+", "-", "*" and "/" 
> in order to be able to perform arithmetic on complex numbers (which have a 
> real and imaginary part)?

Witold,

You may appreciate this old request for native complex number support (from 
2002):
Report No: 957            Status: Closed
Native Complex numbers and Vector support
http://qc.codegear.com/wc/qcmain.aspx?d=957
QCWIN:Defect_No=957

And a couple of other searches will give you more to read:

http://groups.google.com/groups?hl=en&q=%22complex+numbers%22+John+Herbster

http://groups.google.com/groups/search?hl=en&q=Delphi+%22complex+numbers%22

HTH, JohnH
0
John
1/27/2010 1:05:01 AM
Witold Waldman wrote:

> > {quote:title=Rudy Velthuis (TeamB) wrote:}{quote}
> > It is in the demo folder, which is usually not stored together with
> > the Delphi folders. I'm not quite sure where it normally is, since
> > I stored it in a non-default directory, but just search for a
> > folder called <whatever it
> > is>\Demos\DelphiWin32\VCLWin32\ComplexNumbers.
> 
> Rudy,
> 
> Many thanks. I found it in the C:\Documents and Settings\All
> Users\Documents\RAD
> Studio\7.0\Demos\DelphiWin32\VCLWin32\ComplexNumbers folder.

That is the default for Demos on Windows XP, IIRC.

-- 
Rudy Velthuis (TeamB)        http://www.teamb.com

"I have read your book and much like it."
 -- Moses Hadas (1900-1966)
0
Rudy
1/27/2010 1:12:53 AM
Reply:

Similar Artilces:

Delphi XE / Delphi 2010
Hello! I noticed that Embarcadero® Delphi® 2010 Version is not on the list of products on Embarcadero page. Or is it still possible to buy it? Will RAD Studio XE compile programs written in Delphi 2010 without problems.? Thanks. Am 13.09.2010 09:04, schrieb Petra Nemec: > Will RAD Studio XE compile programs written in Delphi 2010 without problems.? As always you will probably have to recreate the projects as the import is still a bit -- special. Christian Hello! Does anybody know if it is still possible to get a Delphi2010 trial version (if yes where)? ...

from delphi 6 to delphi 2010
Hi. It is possible, with component RX, dxforumlibrary, InfoPower3000Pro, StringAlignGrid. Accepts communication BDE. Thank by comments. excequiel arostica wrote: >Hi. > It is possible, with component RX, dxforumlibrary, >InfoPower3000Pro, StringAlignGrid. Accepts communication BDE. > >Thank by comments. Rx is dead and sources are taken over by jcl/jvcl. I dont know about the rest of the components and i have no experiences with bde over the last 9 years. excequiel arostica wrote: > Hi. > It is possible, with component RX, dxforumlibrary,...

Price of upgrade from Delphi 2010 Professional to Delphi 2010 Enterprise?
It's weird, but I could not find the answer on so simple question not in Embarcadero Shop, neither by the forum search. For example, the shop info about Enterprise upgrade says: The Upgrade product is available to registered owners of 2006-2009 versions, blah-blah... So, if I'm Delphi 2010 Professional user, I even not eligible for upgrade? I have to buy a new version of Enterprise??? But if I'm Delphi 2006 Professional user, I can upgrade. Please clarify this nonsense for me. Exact question is in the subject. Thanks! Hi Dmitri, > It's weird, but I could not...

Migrate from Delphi 2007 to Delphi 2010
Hi All, Thanks in advance for your help. Below is my query, Currently I am using Delphi 2007 and i want to migrate to Delphi 2010. 1. What all things i need to take care while doing this? 2. What all third party components will get impacted? 3. Any known issues in Delphi 2010 which might impact the cause? 4. Any changes in database operation required as i am using Oracle? Hope I have post this query under correct category. If not sorry for the trouble and could you please suggest me the correct category for this? Looking forward for your response. Have a great day. Th...

Migrating From Delphi 7 to Delphi 2010
We did not know which forum was the best for this question. We have been wanting to migrate from Delphi 7 to a later version for years but it appears to be a daunting task. We first looked at D2006 and that was a radical new world. We bought D2010 a couple of years ago and not done much with it because there are so many parts to our applications. We have done a few new applications in D2010 and they seem to work okay. D2010 has not been impressive, perhaps because of the strangeness compared to D7. Is is possible for us to do a phased sort of migration where we do a form at a time? ...

Using Delphi 7 and Delphi 2010
I had a project in Delphi 7. I worked on it in Delphi 2010. When I try to open the .dpr again in Delphi 7, the IDE toolbar widens across both monitors, and Delphi 7 locks up. It appears that Delphi 2010 modifies the .dpr in a way that makes Delphi 7 unable to open it again. All my forms & units appear to open fine in D7 after D2010, except for the warnings on the ExplicitHeight and ExplicitWidth properties being missing... I can easily recreate the .dpr, but is this expected behavior? Thanks. Tom Field wrote: > I had a project in Delphi 7. > > I worked o...

delphi 2006 code in delphi 2010
hello, is there any option to make delphi 2006 code work in delphi 2010? something like in java IDEs where you can define the code level you like to use? the problem is, that i made a project with 2006 and sent it to my customer. they got 2010 and it compiles fine, but it just doesn't work. it deals with en-/decryption of text, we assumed, that it has something to do with ansi vs. unicode strings... but we cant find the exact position where the error occurs. i am a bit dissapointed, because everywhere i read that the new IDE will always be downwards compatible and so on.. but in ...

Delphi 2010 w Delphi 2007
I have D2007 installed on my laptop (XP sp3 running on dual core Athlon). Can I install D2010 on this machine without it affecting D2007? Will D2010 affect D2007 in any way? Thanks, Randall Carpenter > {quote:title=Randall Carpenter wrote:}{quote} > I have D2007 installed on my laptop (XP sp3 running on dual core Athlon). > Can I install D2010 on this machine without it affecting D2007? Will D2010 > affect D2007 in any way? Won't hurt a thing. I have D7, RAD Studio 2007, RAD Studio 2009, and RAD Studio 2010 all on my desktop system and they coexist fine. Jus...

Free RAD Studio 2010 and Delphi Prism 2011 with purchase of Delphi 2010
Hi All, For those of you who complain that Delphi (and RAD Studio) is too expensive... for a few short weeks there are two overlapping special offers from Embarcadero that you can use to move up to RAD Studio 2010 including the latest Delphi Prism 2011 for the price of a single Delphi 2010 (New User or Upgrade)... The first "RAD Studio PROMO" offer is still valid until June 28th: when you order Delphi 2010, you get RAD Studio 2010 delivered instead (including Delphi 2010, C++Builder 2010 and Delphi Prism 2010). As of May 26th, the "Delphi Prism 2011" of...

Delphi 2010 professional to Delphi XE3
Hello, Sorry for this is not right place to ask this question: I have Delphi 2010 professional version, I like to upgrade to Delphi XE3 Am eligible to upgrade or no not? I like answer from Delphi sales team. I couldn’t find email to ask them. Thanks Mike Thomas <> wrote in news:506459@forums.embarcadero.com: > Hello, > > Sorry for this is not right place to ask this question: > I have Delphi 2010 professional version, I like to upgrade to Delphi > XE3 Am eligible to upgrade or no not? I like answer from Delphi > sales team. I couldn’t find emai...

Delphi 7 to Delphi 2010
We have decided to move up some applications running under Delphi 7 to Delphi 2010. However, I was surprise to see that simply recompiling the application causes the application to be much slower than version 7. We have a lot of string transformation routines, some mathematical transformations, etc. When I mean slower, I mean up to two times slower than with Delphi 7, so it not a minor difference. (The EXE is also a lot bigger but I don't worry too much about that). Is there something I can do to obtain the same kind of speed I had in Delphi 7 but with Delphi 2010? ...

package conversion from Delphi 5 to Delphi 2010
Hello, I am evaluating 2010 to convert a delphi 5 app up. My first task is to convert some custom control packages. My requires statment looks like this: requires vcl50, Vclx50, VclSmp50, Vcldb50, vcljpg50, What are the delphi 2010 equivalents if any? Is there documentation that I could look at to help with the conversion process? Thanks.. ...Joe.. joe alaimo wrote: > requires > vcl50, > Vclx50, > VclSmp50, > Vcldb50, > vcljpg50, 140 is the 2010 version. > > What are the delphi 2010 equivalents if any? Is t...

Why does this work fine in Delphi 2009, but not in Delphi 2010
I've been racking my head trying to figure this out and can't understand what is wrong, TFileStream.ReadComponentRes fails when I try to read a component containing a record, it works fine in Delphi 2009 and Delphi 2007, but fails with Delphi 2010 Here is the unit source and DFM *+//UnitSource+* unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TThresholdMode = (tm0,tm1,tm2,tm3,tm4,tm5); TThreshold = Record Mode:TThresholdMode; Filter,Start,Stop:Integer; end; ...

Pchar for PansiChar
hello, I use a DLL developed in D7 and not have the same sources. I will use Delphi 2010 and the functions do not work function TkmInitialize(LOGXMLDIR: PChar; TkmByExt: dWord): dWord; stdcall; external 'trackbuffer.dll'; function TkmCreateStream(FileName: PChar; Var Stream: dWord; Var Error: dWord): PChar; stdcall; external 'trackbuffer.dll'; function TkmLogEnd(Stream: dWord; MediaDuration, MediaPosition, MediaType: dWord; MediaName: PChar): dWord; stdcall; external 'trackbuffer.dll'; function TkmIsTkm(FileName: PChar): Bool; stdcall; external 'trackbuffer.dl...

Web resources about - Complex number arithmetic in Delphi 2010 - embarcadero.delphi.general

Arithmetic - Wikipedia, the free encyclopedia
... of numbers , especially the properties of the traditional operations between them— addition , subtraction , multiplication and division . Arithmetic ...

Arithmetic - Wikipedia, the free encyclopedia
... numbers , especially the properties of the traditional operations between them — addition , subtraction , multiplication and division . Arithmetic ...

Mental Arithmetic - train your brain! on the App Store on iTunes
Get Mental Arithmetic - train your brain! on the App Store. See screenshots and ratings, and read customer reviews.

Arithmetic Puzzle - Haskell live coding - YouTube
Live coding of Ruby Quiz 7 - Arithmetic Puzzle "Countdown" Unscripted, unedited, (uncut) - Haskell Uncut Read more at my blog post: http://c ...

Australia's deadliest sniper, Ian Robertson, 'never did the arithmetic'
The deadliest man in Australia comes from Melbourne, but he is not a gangster or a hitman. He is more a foxtrotting man, these days. He can do ...

Genetic anomaly could explain severe difficulty with arithmetic - The Science Show - ABC Radio National ...
... is that numbers are wired into the human brain and perhaps a genetic anomaly explains why some children have severe difficulties with arithmetic. ...

Help your kids master arithmetic with Monster Math 2
... upgrade to Monster Math 2 Pro and get access to new worlds, more advanced reporting, and all of the math skills. Help your kids master arithmetic ...

Price Drop: MencalHD:Mental Arithmetic Training,Improve Your Skills In Math
MencalHD:Mental Arithmetic Training,Improve Your Skills In Math 1.0 Device: iOS iPad Only Category: Education Price: Free, Version: 1.0 ( iTunes ...

Analysis: Republicans' budget plans require creative arithmetic to add up
Pittsburgh Post-Gazette Analysis: Republicans' budget plans require creative arithmetic to add up Bellingham Herald WASHINGTON — Republicans ...

"Here's America today... frivolous entertainment, texting and Twitter replacing serious news reporting ...
If only we weren't so frivolous , if we could get serious , maybe we could figure it all out.

Resources last updated: 12/21/2015 8:16:37 AM