Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #55201 > unrolled thread

complex number in struct form in C

Started byDexterr <dejangru@gmail.com>
First post2014-12-21 07:20 -0800
Last post2014-12-21 17:17 -0800
Articles 11 on this page of 71 — 22 participants

Back to article view | Back to comp.lang.c


Contents

  complex number in struct form in C Dexterr <dejangru@gmail.com> - 2014-12-21 07:20 -0800
    Re: complex number in struct form in C James Kuyper <jameskuyper@verizon.net> - 2014-12-21 11:30 -0500
      Re: complex number in struct form in C Dexterr <dejangru@gmail.com> - 2014-12-21 08:35 -0800
        Re: complex number in struct form in C "Osmium" <r124c4u102@comcast.net> - 2014-12-21 10:54 -0600
          Re: complex number in struct form in C James Kuyper <jameskuyper@verizon.net> - 2014-12-21 12:00 -0500
            Re: complex number in struct form in C "Osmium" <r124c4u102@comcast.net> - 2014-12-21 11:08 -0600
              Re: complex number in struct form in C Barry Schwarz <schwarzb@dqel.com> - 2014-12-21 10:12 -0800
                Re: complex number in struct form in C "Osmium" <r124c4u102@comcast.net> - 2014-12-21 13:22 -0600
                  Re: complex number in struct form in C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-21 22:21 +0000
                Re: complex number in struct form in C asetofsymbols@gmail.com - 2014-12-26 11:34 -0800
                  Re: complex number in struct form in C "Osmium" <r124c4u102@comcast.net> - 2014-12-26 14:10 -0600
                    Re: complex number in struct form in C glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-12-28 07:04 +0000
                      Re: complex number in struct form in C BartC <bc@freeuk.com> - 2014-12-28 13:14 +0000
                        Re: complex number in struct form in C Robert Wessel <robertwessel2@yahoo.com> - 2014-12-28 10:45 -0600
                          Re: complex number in struct form in C Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-28 08:56 -0800
                        Re: complex number in struct form in C glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-12-29 10:10 +0000
                          Re: complex number in struct form in C Kaz Kylheku <kaz@kylheku.com> - 2014-12-29 19:40 +0000
                            Re: complex number in struct form in C glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-12-29 20:54 +0000
                              Re: complex number in struct form in C BartC <bc@freeuk.com> - 2014-12-29 21:55 +0000
                                Re: complex number in struct form in C glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-12-30 03:07 +0000
                                  Re: complex number in struct form in C BartC <bc@freeuk.com> - 2014-12-30 10:51 +0000
                                    Re: complex number in struct form in C Rosario193 <Rosario@invalid.invalid> - 2014-12-30 12:15 +0100
                                    Re: complex number in struct form in C Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-30 03:31 -0800
                                    Re: complex number in struct form in C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-30 12:17 +0000
                                      Re: complex number in struct form in C BartC <bc@freeuk.com> - 2014-12-30 13:18 +0000
                                        Re: complex number in struct form in C Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-30 05:28 -0800
                                          Re: complex number in struct form in C BartC <bc@freeuk.com> - 2014-12-30 13:53 +0000
                                          Re: complex number in struct form in C "Osmium" <r124c4u102@comcast.net> - 2014-12-30 08:53 -0600
                                            Re: complex number in struct form in C "Chris M. Thomasson" <no@spam.invalid> - 2014-12-30 20:05 -0800
                                          Re: complex number in struct form in C Jeff Higgins <jeff@invalid.invalid> - 2014-12-30 17:40 -0500
                                          Re: complex number in struct form in C Tim Rentsch <txr@alumni.caltech.edu> - 2015-03-24 08:58 -0700
                                          Re: complex number in struct form in C Les Cargill <lcargill99@comcast.com> - 2015-03-24 19:41 -0500
                                        Re: complex number in struct form in C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-30 14:59 +0000
                      Re: complex number in struct form in C David Thompson <dave.thompson2@verizon.net> - 2015-01-12 15:33 -0500
                        Re: complex number in struct form in C glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2015-01-12 22:51 +0000
                        Re: complex number in struct form in C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-01-12 23:34 +0000
                  Re: complex number in struct form in C James Kuyper <jameskuyper@verizon.net> - 2014-12-26 15:25 -0500
                    Re: complex number in struct form in C glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-12-28 07:17 +0000
                  Re: complex number in struct form in C BartC <bc@freeuk.com> - 2014-12-26 20:49 +0000
                    Re: complex number in struct form in C asetofsymbols@gmail.com - 2014-12-27 00:22 -0800
                      Re: complex number in struct form in C "Osmium" <r124c4u102@comcast.net> - 2014-12-27 08:25 -0600
                        Re: complex number in struct form in C Geoff <geoff@invalid.invalid> - 2014-12-27 10:20 -0800
                          Re: complex number in struct form in C "Osmium" <r124c4u102@comcast.net> - 2014-12-27 13:21 -0600
                            Re: complex number in struct form in C Geoff <geoff@invalid.invalid> - 2014-12-27 13:11 -0800
                              Re: complex number in struct form in C "Osmium" <r124c4u102@comcast.net> - 2014-12-27 15:36 -0600
                                Re: complex number in struct form in C Geoff <geoff@invalid.invalid> - 2014-12-27 14:54 -0800
                                  Re: complex number in struct form in C Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-27 15:45 -0800
                              Re: complex number in struct form in C Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-27 13:40 -0800
                            Re: complex number in struct form in C James Kuyper <jameskuyper@verizon.net> - 2014-12-28 06:50 -0500
                              Re: complex number in struct form in C Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-28 04:25 -0800
                          Re: complex number in struct form in C James Kuyper <jameskuyper@verizon.net> - 2014-12-28 06:44 -0500
                            Re: complex number in struct form in C Richard Damon <Richard@Damon-Family.org> - 2014-12-28 08:33 -0500
                      Re: complex number in struct form in C James Kuyper <jameskuyper@verizon.net> - 2014-12-27 11:46 -0500
                        Re: complex number in struct form in C glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-12-28 07:28 +0000
                      Re: complex number in struct form in C Kaz Kylheku <kaz@kylheku.com> - 2014-12-27 17:23 +0000
              Re: complex number in struct form in C James Kuyper <jameskuyper@verizon.net> - 2014-12-21 14:37 -0500
            Re: complex number in struct form in C Keith Thompson <kst-u@mib.org> - 2014-12-21 12:37 -0800
            Re: complex number in struct form in C glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-12-22 00:54 +0000
        Re: complex number in struct form in C James Kuyper <jameskuyper@verizon.net> - 2014-12-21 11:54 -0500
        Re: complex number in struct form in C Vincenzo Mercuri <nomail@yahoo.it> - 2014-12-21 18:07 +0100
          Re: complex number in struct form in C Dexterr <dejangru@gmail.com> - 2014-12-21 10:37 -0800
            Re: complex number in struct form in C "Chris M. Thomasson" <no@spam.invalid> - 2014-12-21 10:55 -0800
            Re: complex number in struct form in C raltbos@xs4all.nl (Richard Bos) - 2014-12-22 12:15 +0000
              Re: complex number in struct form in C Dexterr <dejangru@gmail.com> - 2014-12-22 05:51 -0800
                Re: complex number in struct form in C BartC <bc@freeuk.com> - 2014-12-22 14:01 +0000
                  Re: complex number in struct form in C Keith Thompson <kst-u@mib.org> - 2014-12-22 08:02 -0800
              Re: complex number in struct form in C Keith Thompson <kst-u@mib.org> - 2014-12-22 08:03 -0800
      Re: complex number in struct form in C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-12-21 22:27 +0000
    Re: complex number in struct form in C "Chris M. Thomasson" <no@spam.invalid> - 2014-12-21 10:51 -0800
      Re: complex number in struct form in C Dexterr <dejangru@gmail.com> - 2014-12-21 11:14 -0800
    Re: complex number in struct form in C Malcolm McLean <malcolm.mclean5@btinternet.com> - 2014-12-21 17:17 -0800

Page 4 of 4 — ← Prev page 1 2 3 [4]


#55222

FromDexterr <dejangru@gmail.com>
Date2014-12-21 10:37 -0800
Message-ID<a54ba7b4-c3b0-4e22-b731-3d2c8abfe964@googlegroups.com>
In reply to#55212
On Sunday, December 21, 2014 6:07:50 PM UTC+1, Vincenzo Mercuri wrote:
> Il 21/12/2014 17:35, Dexterr ha scritto:
> ..
> > it should be something like this
> >
> > typedef struct _ComplexNumber_ {
> >    float real_part;
> >    float imaginary_part;
> > } CNumber;
> >
> > CNumber complex;
> >
> 
> If you were here to actually learn something, you would at least
> re-re-read what other people had to say about how to choose a proper
> name for your identifiers. I refer to what Ben Bacarisse said upthread:
> 
> http://web.archive.org/web/20040209031039/http://oakroadsystems.com/tech/c-predef.htm#ReservedIdentifiers
> 
> -- 
> Vincenzo Mercuri

If you here to show how smart you are, please don't post anything. I don't need such a crap. I just need someone to correct me in some other way, not such things.

[toc] | [prev] | [next] | [standalone]


#55224

From"Chris M. Thomasson" <no@spam.invalid>
Date2014-12-21 10:55 -0800
Message-ID<m77530$rnc$1@speranza.aioe.org>
In reply to#55222
> "Dexterr"  wrote in message 
> news:a54ba7b4-c3b0-4e22-b731-3d2c8abfe964@googlegroups.com...

> > On Sunday, December 21, 2014 6:07:50 PM UTC+1, Vincenzo Mercuri wrote:
[...]

> If you here to show how smart you are, please don't post
> anything. I don't need such a crap. I just need someone to
> correct me in some other way, not such things.

AFAICT, he his warning you about using a leading underscore. 

[toc] | [prev] | [next] | [standalone]


#55274

Fromraltbos@xs4all.nl (Richard Bos)
Date2014-12-22 12:15 +0000
Message-ID<54980b13.6984968@news.xs4all.nl>
In reply to#55222
Dexterr <dejangru@gmail.com> wrote:

> If you here to show how smart you are, please don't post anything.
> I don't need such a crap. I just need someone to correct me
> in some other way, not such things.

No. What you need, boy, is a bit more civility towards your elders and
betters, whom you are asking for help. Your attitude may be acceptable
in the slums of Belgrade, but it isn't acceptable in adult company.

Richard

[toc] | [prev] | [next] | [standalone]


#55278

FromDexterr <dejangru@gmail.com>
Date2014-12-22 05:51 -0800
Message-ID<86f39191-f93a-4b1a-8c10-24ff50a9ee2f@googlegroups.com>
In reply to#55274
On Monday, December 22, 2014 1:16:12 PM UTC+1, Richard Bos wrote:
> Dexterr <dejangru@gmail.com> wrote:
> 
> > If you here to show how smart you are, please don't post anything.
> > I don't need such a crap. I just need someone to correct me
> > in some other way, not such things.
> 
> No. What you need, boy, is a bit more civility towards your elders and
> betters, whom you are asking for help. Your attitude may be acceptable
> in the slums of Belgrade, but it isn't acceptable in adult company.
> 
> Richard

I just need an answer and thats all. This part of "slums of Belgrade" shows you as a fucking western fashist and I don't need a help from mutherfuckers as you are even if a I am deadly need a help! Fuck you.

[toc] | [prev] | [next] | [standalone]


#55279

FromBartC <bc@freeuk.com>
Date2014-12-22 14:01 +0000
Message-ID<8vVlw.182079$fX6.26538@fx26.am4>
In reply to#55278
On 22/12/2014 13:51, Dexterr wrote:

> I just need an answer and thats all. This part of "slums of Belgrade" shows you as a fucking western fashist and I don't need a help from mutherfuckers as you are even if a I am deadly need a help! Fuck you.

Have I just dropped into a youtube comments section by mistake? It seems 
like it!

You might try another forum such as stackoverflow.com for help with 
technical C problems. That seems to be a younger crowd who would be less 
fazed by your language and attitude.

-- 
Bartc

[toc] | [prev] | [next] | [standalone]


#55288

FromKeith Thompson <kst-u@mib.org>
Date2014-12-22 08:02 -0800
Message-ID<ln4msn8yg8.fsf@nuthaus.mib.org>
In reply to#55279
BartC <bc@freeuk.com> writes:
[...]
> You might try another forum such as stackoverflow.com for help with 
> technical C problems. That seems to be a younger crowd who would be less 
> fazed by your language and attitude.

Not really.  Offensive posts on stackoverflow.com tend to be flagged and
deleted fairly quickly.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#55289

FromKeith Thompson <kst-u@mib.org>
Date2014-12-22 08:03 -0800
Message-ID<lnzjaf7ju3.fsf@nuthaus.mib.org>
In reply to#55274
raltbos@xs4all.nl (Richard Bos) writes:
> Dexterr <dejangru@gmail.com> wrote:
>> If you here to show how smart you are, please don't post anything.
>> I don't need such a crap. I just need someone to correct me
>> in some other way, not such things.
>
> No. What you need, boy, is a bit more civility towards your elders and
> betters, whom you are asking for help. Your attitude may be acceptable
> in the slums of Belgrade, but it isn't acceptable in adult company.

Richard, you're *really* not helping.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#55264

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2014-12-21 22:27 +0000
Message-ID<87ioh4ocyr.fsf@bsb.me.uk>
In reply to#55204
James Kuyper <jameskuyper@verizon.net> writes:
<snip>
> [...] Also, <cmath.h>
> contains complexified versions of the routines in <math.h>.

Did you mean complex.h?  (tgmath.h can also be helpful here as it
unifies all the prefix/suffix naming conventions that have grown up
other years.)

-- 
Ben.

[toc] | [prev] | [next] | [standalone]


#55223

From"Chris M. Thomasson" <no@spam.invalid>
Date2014-12-21 10:51 -0800
Message-ID<m774sl$r79$1@speranza.aioe.org>
In reply to#55201
> "Dexterr"  wrote in message 
> news:bb5abeac-08cd-43de-a54a-5efd27423d80@googlegroups.com...

> Hi there, I am thinking how to make one structure with
> complex number. Complex number has a form (a+b*i)
> and i is an imaginary number i = sqrt(-1).

[...]

> Do you have an idea how to do it properly ?

Using a struct is fine. However using integers seems a bit
out of place wrt complex numbers. Anyway, and FWIW, here
is a link to a program I made that generates the Mandelbrot
Set in ASCII art:

http://codepad.org/lkknRnxq

https://groups.google.com/forum/#!msg/comp.lang.c/V8yxzB5ivGY/Hm-KhlKqFg8J


;^) 

[toc] | [prev] | [next] | [standalone]


#55225

FromDexterr <dejangru@gmail.com>
Date2014-12-21 11:14 -0800
Message-ID<61fe36fd-4ca9-424c-b1b8-1ccd523e0ff4@googlegroups.com>
In reply to#55223
On Sunday, December 21, 2014 7:52:21 PM UTC+1, Chris M. Thomasson wrote:
> > "Dexterr"  wrote in message 
> > news:bb5abeac-08cd-43de-a54a-5efd27423d80@googlegroups.com...
> 
> > Hi there, I am thinking how to make one structure with
> > complex number. Complex number has a form (a+b*i)
> > and i is an imaginary number i = sqrt(-1).
> 
> [...]
> 
> > Do you have an idea how to do it properly ?
> 
> Using a struct is fine. However using integers seems a bit
> out of place wrt complex numbers. Anyway, and FWIW, here
> is a link to a program I made that generates the Mandelbrot
> Set in ASCII art:
> 
> http://codepad.org/lkknRnxq
> 
> https://groups.google.com/forum/#!msg/comp.lang.c/V8yxzB5ivGY/Hm-KhlKqFg8J
> 
> 
> ;^)

Thanks Chris.

[toc] | [prev] | [next] | [standalone]


#55257

FromMalcolm McLean <malcolm.mclean5@btinternet.com>
Date2014-12-21 17:17 -0800
Message-ID<f206383f-d226-4f52-9ab8-b6d837400848@googlegroups.com>
In reply to#55201
On Sunday, December 21, 2014 3:20:21 PM UTC, Dexterr wrote:
> Hi there, I am thinking how to make one structure with complex number. 
> Complex number has a form (a+b*i) and i is an imaginary number 
> i = sqrt(-1).
> 
> struct ComplexNumber {
>  
>    int a;
>    int b;
> 
> } CNumber;
> 
> Do you have an idea how to do it properly ?
>
If you've got a modern C compiler it will come with a complex
maths library. Alternatively, you can download source for such a
package from the web.

If you need to understand how to implement complex maths itself,
then it's a big mathematical subject we couldn't possibly cover in
Usenet. However my book Basic Algorithms has a chapter on complex
numbers, it explains the equation e^PIi + 1 = 0 from first principles,
then goes on to C code for complex maths.

[toc] | [prev] | [standalone]


Page 4 of 4 — ← Prev page 1 2 3 [4]

Back to top | Article view | comp.lang.c


csiph-web