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. Math Puzzle (SOLVED by harold aptroot!)

Math Puzzle (SOLVED by harold aptroot!)

Scheduled Pinned Locked Moved The Lounge
csscomquestion
41 Posts 8 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.
  • L Luc Pattyn

    no need for \! :)

    Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


    Prolific encyclopedia fixture proof-reader browser patron addict?
    We all depend on the beast below.


    A Offline
    A Offline
    AspDotNetDev
    wrote on last edited by
    #20

    Not bad. I added that operator because I wasn't sure it was possible without it. If you have indeed done it without, then great work. :)

    [Forum Guidelines]

    L 1 Reply Last reply
    0
    • A AspDotNetDev

      Not bad. I added that operator because I wasn't sure it was possible without it. If you have indeed done it without, then great work. :)

      [Forum Guidelines]

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #21

      it is only / one needs, since that one has a singularity at zero, hence it allows to construct C-like functions (resulting in 0 or 1) like x>0 and x<0, x>=0 and x<=0, and therefore also x==0. :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


      Prolific encyclopedia fixture proof-reader browser patron addict?
      We all depend on the beast below.


      P 1 Reply Last reply
      0
      • A AspDotNetDev

        Calm down there cowboy. My "stated usage" was just how I thought up this idea. This is just a fun math puzzle to occupy your time should you choose to let it.

        PIEBALDconsult wrote:

        it's just integer division

        Not sure I agree (mod is the remainder from the division), but no shorthand allowed... show your work please. :)

        [Forum Guidelines]

        P Offline
        P Offline
        Phil Martin
        wrote on last edited by
        #22

        aspdotnetdev wrote:

        PIEBALDconsult wrote: it's just integer division Not sure I agree (mod is the remainder from the division),

        Sure it is, since your division rounds: a % b = a - b * (a / b) e.g. 12 % 5 = 12 - 5 * (12 / 5) 2 = 12 - 5 * 2 2 = 2

        L A P 3 Replies Last reply
        0
        • P Phil Martin

          aspdotnetdev wrote:

          PIEBALDconsult wrote: it's just integer division Not sure I agree (mod is the remainder from the division),

          Sure it is, since your division rounds: a % b = a - b * (a / b) e.g. 12 % 5 = 12 - 5 * (12 / 5) 2 = 12 - 5 * 2 2 = 2

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #23

          absolutely, and furthermore PIEBALD will claim the use of the C/C++ pre-processor to introduce and define new operators. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


          Prolific encyclopedia fixture proof-reader browser patron addict?
          We all depend on the beast below.


          A P P 3 Replies Last reply
          0
          • P Phil Martin

            aspdotnetdev wrote:

            PIEBALDconsult wrote: it's just integer division Not sure I agree (mod is the remainder from the division),

            Sure it is, since your division rounds: a % b = a - b * (a / b) e.g. 12 % 5 = 12 - 5 * (12 / 5) 2 = 12 - 5 * 2 2 = 2

            A Offline
            A Offline
            AspDotNetDev
            wrote on last edited by
            #24

            Thanks for the info. :)

            [Forum Guidelines]

            1 Reply Last reply
            0
            • L Luc Pattyn

              absolutely, and furthermore PIEBALD will claim the use of the C/C++ pre-processor to introduce and define new operators. :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


              Prolific encyclopedia fixture proof-reader browser patron addict?
              We all depend on the beast below.


              A Offline
              A Offline
              AspDotNetDev
              wrote on last edited by
              #25

              Just so long as he shows his work. :)

              [Forum Guidelines]

              1 Reply Last reply
              0
              • L Luc Pattyn

                absolutely, and furthermore PIEBALD will claim the use of the C/C++ pre-processor to introduce and define new operators. :)

                Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                Prolific encyclopedia fixture proof-reader browser patron addict?
                We all depend on the beast below.


                P Offline
                P Offline
                Phil Martin
                wrote on last edited by
                #26

                C++ Preprocessor? That's so kitsch. Prolog operators all the way!

                1 Reply Last reply
                0
                • L Luc Pattyn

                  it is only / one needs, since that one has a singularity at zero, hence it allows to construct C-like functions (resulting in 0 or 1) like x>0 and x<0, x>=0 and x<=0, and therefore also x==0. :)

                  Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                  Prolific encyclopedia fixture proof-reader browser patron addict?
                  We all depend on the beast below.


                  P Offline
                  P Offline
                  Phil Martin
                  wrote on last edited by
                  #27

                  Man, all that money wasted on finding the Higgs Boson, when it was hiding in the divide by zero all along!

                  L 1 Reply Last reply
                  0
                  • P Phil Martin

                    Man, all that money wasted on finding the Higgs Boson, when it was hiding in the divide by zero all along!

                    L Offline
                    L Offline
                    Luc Pattyn
                    wrote on last edited by
                    #28

                    it is not only at zero, it is everywhere, we are just too blind to see it. :)

                    Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                    Prolific encyclopedia fixture proof-reader browser patron addict?
                    We all depend on the beast below.


                    A 1 Reply Last reply
                    0
                    • L Luc Pattyn

                      it is not only at zero, it is everywhere, we are just too blind to see it. :)

                      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                      Prolific encyclopedia fixture proof-reader browser patron addict?
                      We all depend on the beast below.


                      A Offline
                      A Offline
                      AspDotNetDev
                      wrote on last edited by
                      #29

                      Luc Pattyn wrote:

                      we are just too blind to see it

                      That'll teach you to look directly into a singularity. Those accretion discs will get you every time.

                      [Forum Guidelines]

                      P 1 Reply Last reply
                      0
                      • L Luc Pattyn

                        absolutely, and furthermore PIEBALD will claim the use of the C/C++ pre-processor to introduce and define new operators. :)

                        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                        Prolific encyclopedia fixture proof-reader browser patron addict?
                        We all depend on the beast below.


                        P Offline
                        P Offline
                        PIEBALDconsult
                        wrote on last edited by
                        #30

                        :-D I was this close to using C rather than C#... Besides, he invented the \ operator. X|

                        L A 2 Replies Last reply
                        0
                        • P PIEBALDconsult

                          :-D I was this close to using C rather than C#... Besides, he invented the \ operator. X|

                          L Offline
                          L Offline
                          Luc Pattyn
                          wrote on last edited by
                          #31

                          PIEBALDconsult wrote:

                          Besides, he invented the \ operator

                          I only know \ from several Basic systems including VB. And I don't really like it, so I did not use it. :)

                          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                          Prolific encyclopedia fixture proof-reader browser patron addict?
                          We all depend on the beast below.


                          P 1 Reply Last reply
                          0
                          • P Phil Martin

                            aspdotnetdev wrote:

                            PIEBALDconsult wrote: it's just integer division Not sure I agree (mod is the remainder from the division),

                            Sure it is, since your division rounds: a % b = a - b * (a / b) e.g. 12 % 5 = 12 - 5 * (12 / 5) 2 = 12 - 5 * 2 2 = 2

                            P Offline
                            P Offline
                            PIEBALDconsult
                            wrote on last edited by
                            #32

                            Actually, I would likely define it using repeated subtraction; so it should still be allowed. :-D

                            1 Reply Last reply
                            0
                            • L Luc Pattyn

                              PIEBALDconsult wrote:

                              Besides, he invented the \ operator

                              I only know \ from several Basic systems including VB. And I don't really like it, so I did not use it. :)

                              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


                              Prolific encyclopedia fixture proof-reader browser patron addict?
                              We all depend on the beast below.


                              P Offline
                              P Offline
                              PIEBALDconsult
                              wrote on last edited by
                              #33

                              Huh... I've never heard of it. Turbo BASIC has it. Dartmouth BASIC doesn't seem to. BASIC-Plus doesn't. Seems to be an abomination.

                              1 Reply Last reply
                              0
                              • A AspDotNetDev

                                Luc Pattyn wrote:

                                we are just too blind to see it

                                That'll teach you to look directly into a singularity. Those accretion discs will get you every time.

                                [Forum Guidelines]

                                P Offline
                                P Offline
                                PIEBALDconsult
                                wrote on last edited by
                                #34

                                She was only a particle physicist's daughter, but she had big accretion discs. :cool:

                                1 Reply Last reply
                                0
                                • P PIEBALDconsult

                                  :-D I was this close to using C rather than C#... Besides, he invented the \ operator. X|

                                  A Offline
                                  A Offline
                                  AspDotNetDev
                                  wrote on last edited by
                                  #35

                                  Different languages have different uses for backslash. I did arbitrarily assign each slash to a particular type of integer division (was not based on any programming language). Gotta keep you on your toes. :)

                                  [Forum Guidelines]

                                  1 Reply Last reply
                                  0
                                  • A AspDotNetDev

                                    Gwenio wrote:

                                    you should really make sure such a problem has an answer before presenting it as a puzzle

                                    You might want to tell these guys that. ;) Also, I intuited that it was possible. If it wasn't, then a proof of why it wasn't would have been equally valid. :)

                                    [Forum Guidelines]

                                    C Offline
                                    C Offline
                                    CPallini
                                    wrote on last edited by
                                    #36

                                    aspdotnetdev wrote:

                                    You might want to tell these guys that. Wink Also, I intuited that it was possible. If it wasn't, then a proof of why it wasn't would have been equally valid.

                                    Well, you should give a prize then. :)

                                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                    [My articles]

                                    A 1 Reply Last reply
                                    0
                                    • C CPallini

                                      aspdotnetdev wrote:

                                      You might want to tell these guys that. Wink Also, I intuited that it was possible. If it wasn't, then a proof of why it wasn't would have been equally valid.

                                      Well, you should give a prize then. :)

                                      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                      [My articles]

                                      A Offline
                                      A Offline
                                      AspDotNetDev
                                      wrote on last edited by
                                      #37

                                      I did, I gave him a nice shiny 5 vote. What better prize is there?

                                      [Forum Guidelines]

                                      C 1 Reply Last reply
                                      0
                                      • A AspDotNetDev

                                        I did, I gave him a nice shiny 5 vote. What better prize is there?

                                        [Forum Guidelines]

                                        C Offline
                                        C Offline
                                        CPallini
                                        wrote on last edited by
                                        #38

                                        :beer: :pizza: for instance. :-D

                                        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                        [My articles]

                                        A 1 Reply Last reply
                                        0
                                        • C CPallini

                                          :beer: :pizza: for instance. :-D

                                          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                          [My articles]

                                          A Offline
                                          A Offline
                                          AspDotNetDev
                                          wrote on last edited by
                                          #39

                                          *searches freezer for pizza*

                                          [Forum Guidelines]

                                          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