Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. The History of "i" [modified]

The History of "i" [modified]

Scheduled Pinned Locked Moved The Lounge
databasetutorialquestionloungelearning
56 Posts 37 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A alex barylski

    You know the ubiqious "i" found in almost every example of a for loop for newbies? On another forum were having this disscussion (sorta)... I said (I believe I read it in an C K&R book) that it's because it's simply an alias for Index which is what "i" is usually doing in a for loop...?? Someone else says it has to do with: They are from general Summation Notation that, like many other mathmatical notations, worked its way into early languages -- specifically Fortran (remember its FORMula TRANSlation) I never would have guessed :P Cheers :) It's frustrating being a genius and living the life of a moron!!! -- modified at 21:18 Wednesday 4th October, 2006

    M Offline
    M Offline
    Mircea Grelus
    wrote on last edited by
    #6

    This brings back memories from the times there was no i. FOR n=0 TO 5 ... NEXT n :) regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

    V H 2 Replies Last reply
    0
    • J Jeremy Falcon

      Hockey wrote:

      You know the ubiqious "i" found in almost every example of a for loop for newbies?

      I have always used x for that. It's the new-old-cool thing. :) Jeremy Falcon

      E Offline
      E Offline
      El Corazon
      wrote on last edited by
      #7

      Jeremy Falcon wrote:

      I have always used x for that. It's the new-old-cool thing.

      :shudder: except that x/X has spatial relationships automatically associated with its use. X and Y on a graph, X,Y,Z in 3D space. When I see x, I see spatial expectations. Personally I think that the use of 'i' comes from deeper inside. Is it the choice of 'i' because of the word integer or is the choice of 'i' as the first integer in Fortran because of a more narcissistic mathematical perspective. :rolleyes: _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

      J 2 Replies Last reply
      0
      • M Mircea Grelus

        This brings back memories from the times there was no i. FOR n=0 TO 5 ... NEXT n :) regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

        V Offline
        V Offline
        Vikram A Punathambekar
        wrote on last edited by
        #8

        What do you mean by "the times there was no i"? :~ Cheers, Vikram.


        I don't know and you don't either. Militant Agnostic

        R 1 Reply Last reply
        0
        • A alex barylski

          You know the ubiqious "i" found in almost every example of a for loop for newbies? On another forum were having this disscussion (sorta)... I said (I believe I read it in an C K&R book) that it's because it's simply an alias for Index which is what "i" is usually doing in a for loop...?? Someone else says it has to do with: They are from general Summation Notation that, like many other mathmatical notations, worked its way into early languages -- specifically Fortran (remember its FORMula TRANSlation) I never would have guessed :P Cheers :) It's frustrating being a genius and living the life of a moron!!! -- modified at 21:18 Wednesday 4th October, 2006

          P Offline
          P Offline
          peterchen
          wrote on last edited by
          #9

          Math and Physics use "common meanings" for many variable names and symbols. Even though it is important to declare them (as they are overlapping and not wholly universal), if you just scribble down something, often the meaning is implied. At the very least, each publication uses a "consistent" set. Different areas use overlapping sets of symbols (which makes cross-disciplinary papers often a pain). Some, like the lambda are very... promiscuous: you like to use them, but you never trust them. The machanisms - the writer is expected to be consistent, following standards, so the reader can easily understand the meaning from context without "reading" the declarations - are very similar to naming rules in software. Fortran makes mathmaticians happy, which were the first guys using computers anyway. Math was the typical playground for coder brains back when computers were not there. So for me, having written thoudans of "Sum/Product over i=1..n of foo", there is no real surprise here.


          Some of us walk the memory lane, others plummet into a rabbit hole
          Tree in C# || Fold With Us! || sighist

          1 Reply Last reply
          0
          • A alex barylski

            You know the ubiqious "i" found in almost every example of a for loop for newbies? On another forum were having this disscussion (sorta)... I said (I believe I read it in an C K&R book) that it's because it's simply an alias for Index which is what "i" is usually doing in a for loop...?? Someone else says it has to do with: They are from general Summation Notation that, like many other mathmatical notations, worked its way into early languages -- specifically Fortran (remember its FORMula TRANSlation) I never would have guessed :P Cheers :) It's frustrating being a genius and living the life of a moron!!! -- modified at 21:18 Wednesday 4th October, 2006

            Steve EcholsS Offline
            Steve EcholsS Offline
            Steve Echols
            wrote on last edited by
            #10

            i, j, k as loop variables are as natural as x, y, z are for describing points in 3space. You know immediately what the intent is, or maybe I've been around the block a few too many times. Just my humble opinion, of course...


            - S 50 cups of coffee and you know it's on!

            • S
              50 cups of coffee and you know it's on!
              Code, follow, or get out of the way.
            1 Reply Last reply
            0
            • A alex barylski

              You know the ubiqious "i" found in almost every example of a for loop for newbies? On another forum were having this disscussion (sorta)... I said (I believe I read it in an C K&R book) that it's because it's simply an alias for Index which is what "i" is usually doing in a for loop...?? Someone else says it has to do with: They are from general Summation Notation that, like many other mathmatical notations, worked its way into early languages -- specifically Fortran (remember its FORMula TRANSlation) I never would have guessed :P Cheers :) It's frustrating being a genius and living the life of a moron!!! -- modified at 21:18 Wednesday 4th October, 2006

              R Offline
              R Offline
              Roger Wright
              wrote on last edited by
              #11

              In mathematics, i, j, and k are universal - they are used as integers, indices and to designate imaginary axes for vector quantities. This bled over into FORTRAN when computers were run almost exclusively for mathematicians and has stuck for decades. The use of n is a fairly new development, but it was only a matter of time before we ran out of integers. Fortunately, x and y are still usable for real numbers, and one has to grant them credit - there are an awful lot of real numbers. These valiant variables don't get half the credit they deserve... Engineers have done what we can to preserve the available pool of numeric variables. We use x, y, and z to designate unit vector directions, thereby reducing the load that i, j, and k have to carry. Recognizing the need to conserve, we have also adopted the variable s to designate the special value jw, mainly because it makes the math a lot easier. "...a photo album is like Life, but flat and stuck to pages." - Shog9

              Steve EcholsS J 2 Replies Last reply
              0
              • R Roger Wright

                In mathematics, i, j, and k are universal - they are used as integers, indices and to designate imaginary axes for vector quantities. This bled over into FORTRAN when computers were run almost exclusively for mathematicians and has stuck for decades. The use of n is a fairly new development, but it was only a matter of time before we ran out of integers. Fortunately, x and y are still usable for real numbers, and one has to grant them credit - there are an awful lot of real numbers. These valiant variables don't get half the credit they deserve... Engineers have done what we can to preserve the available pool of numeric variables. We use x, y, and z to designate unit vector directions, thereby reducing the load that i, j, and k have to carry. Recognizing the need to conserve, we have also adopted the variable s to designate the special value jw, mainly because it makes the math a lot easier. "...a photo album is like Life, but flat and stuck to pages." - Shog9

                Steve EcholsS Offline
                Steve EcholsS Offline
                Steve Echols
                wrote on last edited by
                #12

                Roger Wright wrote:

                The use of n is a fairly new development

                I think n might be a hungarian notation artifact, meaning "number". I have found it it in a lot of my old code. :-O


                - S 50 cups of coffee and you know it's on!

                • S
                  50 cups of coffee and you know it's on!
                  Code, follow, or get out of the way.
                1 Reply Last reply
                0
                • V Vikram A Punathambekar

                  What do you mean by "the times there was no i"? :~ Cheers, Vikram.


                  I don't know and you don't either. Militant Agnostic

                  R Offline
                  R Offline
                  Ryan Binns
                  wrote on last edited by
                  #13

                  Vikram A Punathambekar wrote:

                  What do you mean by "the times there was no i"?

                  'i' is a very recent letter. Discovered in 1984 by a French astrologer I believe :rolleyes:

                  Ryan

                  "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                  M 1 Reply Last reply
                  0
                  • A alex barylski

                    You know the ubiqious "i" found in almost every example of a for loop for newbies? On another forum were having this disscussion (sorta)... I said (I believe I read it in an C K&R book) that it's because it's simply an alias for Index which is what "i" is usually doing in a for loop...?? Someone else says it has to do with: They are from general Summation Notation that, like many other mathmatical notations, worked its way into early languages -- specifically Fortran (remember its FORMula TRANSlation) I never would have guessed :P Cheers :) It's frustrating being a genius and living the life of a moron!!! -- modified at 21:18 Wednesday 4th October, 2006

                    R Offline
                    R Offline
                    Rage
                    wrote on last edited by
                    #14

                    it is only "i" like "i"nteger, or "s" like "s"tring. ~RaGE();

                    Steve EcholsS 1 Reply Last reply
                    0
                    • R Ryan Binns

                      Vikram A Punathambekar wrote:

                      What do you mean by "the times there was no i"?

                      'i' is a very recent letter. Discovered in 1984 by a French astrologer I believe :rolleyes:

                      Ryan

                      "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                      M Offline
                      M Offline
                      MatthysDT
                      wrote on last edited by
                      #15

                      How does one discover a letter? :laugh::confused:

                      D L 2 Replies Last reply
                      0
                      • C Christian Graus

                        I thought i/j/k were commonly used in mathematical circles, and so they just moved in to code. Christian Graus - Microsoft MVP - C++

                        C Offline
                        C Offline
                        Chris Maunder
                        wrote on last edited by
                        #16

                        i is reserved for sqrt(-1) cheers, Chris Maunder

                        CodeProject.com : C++ MVP

                        D C F R 4 Replies Last reply
                        0
                        • R Rage

                          it is only "i" like "i"nteger, or "s" like "s"tring. ~RaGE();

                          Steve EcholsS Offline
                          Steve EcholsS Offline
                          Steve Echols
                          wrote on last edited by
                          #17

                          Rage wrote:

                          "i" like "i"nteger, or "s" like "s"tring

                          Much like hungarian notation, which I happen to like (I'm not hungarian), but am slowly being converted to camelCase (I'm not a camel either).


                          - S 50 cups of coffee and you know it's on!

                          • S
                            50 cups of coffee and you know it's on!
                            Code, follow, or get out of the way.
                          R 1 Reply Last reply
                          0
                          • C Chris Maunder

                            i is reserved for sqrt(-1) cheers, Chris Maunder

                            CodeProject.com : C++ MVP

                            D Offline
                            D Offline
                            David Stone
                            wrote on last edited by
                            #18

                            Chris Maunder wrote:

                            i is reserved for sqrt(-1)

                            We're not going to start this discussion again...are we? :~

                            They dress you up in white satin, And give you your very own pair of wings In August and Everything After

                            I'm after everything

                            R C P 3 Replies Last reply
                            0
                            • M MatthysDT

                              How does one discover a letter? :laugh::confused:

                              D Offline
                              D Offline
                              David Stone
                              wrote on last edited by
                              #19

                              I normally throw spaghetti up against the wall. Then, when I see an interesting pattern, I write it down. And that's how I discover new letters. Coming up with the pronunciation for those letters is a little difficult though. :rolleyes:

                              They dress you up in white satin, And give you your very own pair of wings In August and Everything After

                              I'm after everything

                              R 1 Reply Last reply
                              0
                              • D David Stone

                                I normally throw spaghetti up against the wall. Then, when I see an interesting pattern, I write it down. And that's how I discover new letters. Coming up with the pronunciation for those letters is a little difficult though. :rolleyes:

                                They dress you up in white satin, And give you your very own pair of wings In August and Everything After

                                I'm after everything

                                R Offline
                                R Offline
                                Ryan Binns
                                wrote on last edited by
                                #20

                                David Stone wrote:

                                Coming up with the pronunciation for those letters is a little difficult though.

                                Give the spaghetti to someone who eats with their mouth open and listen to the interesting sounds that emerge :)

                                Ryan

                                "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                                L 1 Reply Last reply
                                0
                                • Steve EcholsS Steve Echols

                                  Rage wrote:

                                  "i" like "i"nteger, or "s" like "s"tring

                                  Much like hungarian notation, which I happen to like (I'm not hungarian), but am slowly being converted to camelCase (I'm not a camel either).


                                  - S 50 cups of coffee and you know it's on!

                                  R Offline
                                  R Offline
                                  Ryan Binns
                                  wrote on last edited by
                                  #21

                                  Steve Echols wrote:

                                  I'm not a camel either

                                  :laugh: Are you sure?

                                  Ryan

                                  "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                                  Steve EcholsS 1 Reply Last reply
                                  0
                                  • D David Stone

                                    Chris Maunder wrote:

                                    i is reserved for sqrt(-1)

                                    We're not going to start this discussion again...are we? :~

                                    They dress you up in white satin, And give you your very own pair of wings In August and Everything After

                                    I'm after everything

                                    R Offline
                                    R Offline
                                    Ryan Binns
                                    wrote on last edited by
                                    #22

                                    David Stone wrote:

                                    We're not going to start this discussion again...are we?

                                    What discussion? :-O

                                    Ryan

                                    "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                                    1 Reply Last reply
                                    0
                                    • R Ryan Binns

                                      Steve Echols wrote:

                                      I'm not a camel either

                                      :laugh: Are you sure?

                                      Ryan

                                      "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                                      Steve EcholsS Offline
                                      Steve EcholsS Offline
                                      Steve Echols
                                      wrote on last edited by
                                      #23

                                      :laugh: No humps! Just double checked. Although...hunching over my monitor might give me a "single" in a couple more years. :)


                                      - S 50 cups of coffee and you know it's on!

                                      • S
                                        50 cups of coffee and you know it's on!
                                        Code, follow, or get out of the way.
                                      L 1 Reply Last reply
                                      0
                                      • D David Stone

                                        Chris Maunder wrote:

                                        i is reserved for sqrt(-1)

                                        We're not going to start this discussion again...are we? :~

                                        They dress you up in white satin, And give you your very own pair of wings In August and Everything After

                                        I'm after everything

                                        C Offline
                                        C Offline
                                        code frog 0
                                        wrote on last edited by
                                        #24

                                        Quit being irrational!:laugh:


                                        The enemy's gate is down. :cool: Welcome to CP in your language. Post the unicode version in My CP Blog[^] now.

                                        K 1 Reply Last reply
                                        0
                                        • M Mircea Grelus

                                          This brings back memories from the times there was no i. FOR n=0 TO 5 ... NEXT n :) regards, Mircea Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.

                                          H Offline
                                          H Offline
                                          Henrik Husted
                                          wrote on last edited by
                                          #25

                                          So you also programmed on ZX Spectrum :)

                                          M 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups