$123456789123456789 times 2$ [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-4
down vote

favorite












I was trying really large number multiplication.



Stuff like 123456789123456789 x 2



Now, if you do this, the long-form multiplication way on a paper and pen, You'd get some answer, that .. trivially you'd know 100% is correct... I would imagine you can't go wrong multiplying that on your own.. even in your head..



Now, when you'd try to do that on say a calc app on Windows/Linux/Google/Duckduckgo.. or even Excel / LibreOffice calc (I tried all of them).. You'd get an answer that is slightly different..



The 3 least-significant digits are 000 .. instead of the actual digits.



The question was, why is there a difference. What is the computer not being able to handle.



As it turned out, some of these apps, simply used the default multiplication algorithms provided by the OS which meant, it used code that truncates or gives a closest estimate.



Packages such as wolfram alpha and others ... that are specifically designed to handle computation, are doing it just fine.



In a rush, I had asked this question, I should have gone to wolfram alpha before bothering elite mathematicians on the stack-exchange.. and I am sorry for that :)







share|cite|improve this question














closed as unclear what you're asking by Shaun, zipirovich, Clement C., Claude Leibovici, Siong Thye Goh Aug 14 at 5:05


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • give us more details? what do you get? how do you get them?
    – Siong Thye Goh
    Aug 14 at 4:46






  • 1




    What is the answer you get with pen and paper? What is the answer you get on a calculator?
    – Arthur
    Aug 14 at 4:52










  • Well I didn't mention what I get with a pen-and-paper as this is a highly trivial question to solve with a pen-and-paper... I tried libre-calc, duckduckgo's in-built calculator and ubuntu's calc software ..and all gave me varying results.. but mostly they weren't exactly what you'd get with a pen-and-paper.. which is.. 246913578246913578
    – Omar Ali
    Aug 14 at 5:04






  • 2




    Try Wolfram Alpha.
    – steven gregory
    Aug 14 at 5:09











  • @stevengregory, thanks .. I tried it..and yes it.. gives a proper answer. Which is to say.. phew.. I was wondering what was wrong with computers :)
    – Omar Ali
    Aug 14 at 9:32














up vote
-4
down vote

favorite












I was trying really large number multiplication.



Stuff like 123456789123456789 x 2



Now, if you do this, the long-form multiplication way on a paper and pen, You'd get some answer, that .. trivially you'd know 100% is correct... I would imagine you can't go wrong multiplying that on your own.. even in your head..



Now, when you'd try to do that on say a calc app on Windows/Linux/Google/Duckduckgo.. or even Excel / LibreOffice calc (I tried all of them).. You'd get an answer that is slightly different..



The 3 least-significant digits are 000 .. instead of the actual digits.



The question was, why is there a difference. What is the computer not being able to handle.



As it turned out, some of these apps, simply used the default multiplication algorithms provided by the OS which meant, it used code that truncates or gives a closest estimate.



Packages such as wolfram alpha and others ... that are specifically designed to handle computation, are doing it just fine.



In a rush, I had asked this question, I should have gone to wolfram alpha before bothering elite mathematicians on the stack-exchange.. and I am sorry for that :)







share|cite|improve this question














closed as unclear what you're asking by Shaun, zipirovich, Clement C., Claude Leibovici, Siong Thye Goh Aug 14 at 5:05


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • give us more details? what do you get? how do you get them?
    – Siong Thye Goh
    Aug 14 at 4:46






  • 1




    What is the answer you get with pen and paper? What is the answer you get on a calculator?
    – Arthur
    Aug 14 at 4:52










  • Well I didn't mention what I get with a pen-and-paper as this is a highly trivial question to solve with a pen-and-paper... I tried libre-calc, duckduckgo's in-built calculator and ubuntu's calc software ..and all gave me varying results.. but mostly they weren't exactly what you'd get with a pen-and-paper.. which is.. 246913578246913578
    – Omar Ali
    Aug 14 at 5:04






  • 2




    Try Wolfram Alpha.
    – steven gregory
    Aug 14 at 5:09











  • @stevengregory, thanks .. I tried it..and yes it.. gives a proper answer. Which is to say.. phew.. I was wondering what was wrong with computers :)
    – Omar Ali
    Aug 14 at 9:32












up vote
-4
down vote

favorite









up vote
-4
down vote

favorite











I was trying really large number multiplication.



Stuff like 123456789123456789 x 2



Now, if you do this, the long-form multiplication way on a paper and pen, You'd get some answer, that .. trivially you'd know 100% is correct... I would imagine you can't go wrong multiplying that on your own.. even in your head..



Now, when you'd try to do that on say a calc app on Windows/Linux/Google/Duckduckgo.. or even Excel / LibreOffice calc (I tried all of them).. You'd get an answer that is slightly different..



The 3 least-significant digits are 000 .. instead of the actual digits.



The question was, why is there a difference. What is the computer not being able to handle.



As it turned out, some of these apps, simply used the default multiplication algorithms provided by the OS which meant, it used code that truncates or gives a closest estimate.



Packages such as wolfram alpha and others ... that are specifically designed to handle computation, are doing it just fine.



In a rush, I had asked this question, I should have gone to wolfram alpha before bothering elite mathematicians on the stack-exchange.. and I am sorry for that :)







share|cite|improve this question














I was trying really large number multiplication.



Stuff like 123456789123456789 x 2



Now, if you do this, the long-form multiplication way on a paper and pen, You'd get some answer, that .. trivially you'd know 100% is correct... I would imagine you can't go wrong multiplying that on your own.. even in your head..



Now, when you'd try to do that on say a calc app on Windows/Linux/Google/Duckduckgo.. or even Excel / LibreOffice calc (I tried all of them).. You'd get an answer that is slightly different..



The 3 least-significant digits are 000 .. instead of the actual digits.



The question was, why is there a difference. What is the computer not being able to handle.



As it turned out, some of these apps, simply used the default multiplication algorithms provided by the OS which meant, it used code that truncates or gives a closest estimate.



Packages such as wolfram alpha and others ... that are specifically designed to handle computation, are doing it just fine.



In a rush, I had asked this question, I should have gone to wolfram alpha before bothering elite mathematicians on the stack-exchange.. and I am sorry for that :)









share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Aug 16 at 5:05

























asked Aug 14 at 4:41









Omar Ali

63




63




closed as unclear what you're asking by Shaun, zipirovich, Clement C., Claude Leibovici, Siong Thye Goh Aug 14 at 5:05


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by Shaun, zipirovich, Clement C., Claude Leibovici, Siong Thye Goh Aug 14 at 5:05


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • give us more details? what do you get? how do you get them?
    – Siong Thye Goh
    Aug 14 at 4:46






  • 1




    What is the answer you get with pen and paper? What is the answer you get on a calculator?
    – Arthur
    Aug 14 at 4:52










  • Well I didn't mention what I get with a pen-and-paper as this is a highly trivial question to solve with a pen-and-paper... I tried libre-calc, duckduckgo's in-built calculator and ubuntu's calc software ..and all gave me varying results.. but mostly they weren't exactly what you'd get with a pen-and-paper.. which is.. 246913578246913578
    – Omar Ali
    Aug 14 at 5:04






  • 2




    Try Wolfram Alpha.
    – steven gregory
    Aug 14 at 5:09











  • @stevengregory, thanks .. I tried it..and yes it.. gives a proper answer. Which is to say.. phew.. I was wondering what was wrong with computers :)
    – Omar Ali
    Aug 14 at 9:32
















  • give us more details? what do you get? how do you get them?
    – Siong Thye Goh
    Aug 14 at 4:46






  • 1




    What is the answer you get with pen and paper? What is the answer you get on a calculator?
    – Arthur
    Aug 14 at 4:52










  • Well I didn't mention what I get with a pen-and-paper as this is a highly trivial question to solve with a pen-and-paper... I tried libre-calc, duckduckgo's in-built calculator and ubuntu's calc software ..and all gave me varying results.. but mostly they weren't exactly what you'd get with a pen-and-paper.. which is.. 246913578246913578
    – Omar Ali
    Aug 14 at 5:04






  • 2




    Try Wolfram Alpha.
    – steven gregory
    Aug 14 at 5:09











  • @stevengregory, thanks .. I tried it..and yes it.. gives a proper answer. Which is to say.. phew.. I was wondering what was wrong with computers :)
    – Omar Ali
    Aug 14 at 9:32















give us more details? what do you get? how do you get them?
– Siong Thye Goh
Aug 14 at 4:46




give us more details? what do you get? how do you get them?
– Siong Thye Goh
Aug 14 at 4:46




1




1




What is the answer you get with pen and paper? What is the answer you get on a calculator?
– Arthur
Aug 14 at 4:52




What is the answer you get with pen and paper? What is the answer you get on a calculator?
– Arthur
Aug 14 at 4:52












Well I didn't mention what I get with a pen-and-paper as this is a highly trivial question to solve with a pen-and-paper... I tried libre-calc, duckduckgo's in-built calculator and ubuntu's calc software ..and all gave me varying results.. but mostly they weren't exactly what you'd get with a pen-and-paper.. which is.. 246913578246913578
– Omar Ali
Aug 14 at 5:04




Well I didn't mention what I get with a pen-and-paper as this is a highly trivial question to solve with a pen-and-paper... I tried libre-calc, duckduckgo's in-built calculator and ubuntu's calc software ..and all gave me varying results.. but mostly they weren't exactly what you'd get with a pen-and-paper.. which is.. 246913578246913578
– Omar Ali
Aug 14 at 5:04




2




2




Try Wolfram Alpha.
– steven gregory
Aug 14 at 5:09





Try Wolfram Alpha.
– steven gregory
Aug 14 at 5:09













@stevengregory, thanks .. I tried it..and yes it.. gives a proper answer. Which is to say.. phew.. I was wondering what was wrong with computers :)
– Omar Ali
Aug 14 at 9:32




@stevengregory, thanks .. I tried it..and yes it.. gives a proper answer. Which is to say.. phew.. I was wondering what was wrong with computers :)
– Omar Ali
Aug 14 at 9:32










3 Answers
3






active

oldest

votes

















up vote
3
down vote



accepted










Back when we used handheld calculators they typically could only store $8, 10$ or $12$ decimal digits. The apps on many computers have maintained that limitation. Before that we had slide rules and could only operate with about three digits. Your multiply demands $18$ decimal digits. A computer that uses $64$ bit integers will get this right. There are many software packages that use arbitrary precision integers and they will get this right as well. A computer that uses $32$ bit integers can only do this by converting to floating point and will not have enough precision to get all the places correct. This is not math, this is computing. All of these computing devices make compromises in the interest of doing useful work. They do useful work. The user must understand the limitations and find ways around them if they are a problem. There is a whole field called numerical analysis which finds clever ways to avoid the problems.






share|cite|improve this answer



























    up vote
    0
    down vote













    That is because of register width limitation. If you want to manipulate numbers that don't fit into registers, you need to use different techniques.






    share|cite|improve this answer



























      up vote
      0
      down vote













      This depends on what computer and programme you use. Any supercomputer will get the right answer. Plus, you may have made an error in your pen & paper calculation.






      share|cite|improve this answer






















      • Use the programme GAP. It works there.
        – Shaun
        Aug 14 at 4:49










      • Using a "supercomputer" doesn't necessarily guarantee a correct answer. And, conversely, a correct answer can be obtained on a very small computer if it represents numbers the right way. Number representation is the key, not the size of the computer.
        – bubba
        Aug 14 at 12:50

















      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      3
      down vote



      accepted










      Back when we used handheld calculators they typically could only store $8, 10$ or $12$ decimal digits. The apps on many computers have maintained that limitation. Before that we had slide rules and could only operate with about three digits. Your multiply demands $18$ decimal digits. A computer that uses $64$ bit integers will get this right. There are many software packages that use arbitrary precision integers and they will get this right as well. A computer that uses $32$ bit integers can only do this by converting to floating point and will not have enough precision to get all the places correct. This is not math, this is computing. All of these computing devices make compromises in the interest of doing useful work. They do useful work. The user must understand the limitations and find ways around them if they are a problem. There is a whole field called numerical analysis which finds clever ways to avoid the problems.






      share|cite|improve this answer
























        up vote
        3
        down vote



        accepted










        Back when we used handheld calculators they typically could only store $8, 10$ or $12$ decimal digits. The apps on many computers have maintained that limitation. Before that we had slide rules and could only operate with about three digits. Your multiply demands $18$ decimal digits. A computer that uses $64$ bit integers will get this right. There are many software packages that use arbitrary precision integers and they will get this right as well. A computer that uses $32$ bit integers can only do this by converting to floating point and will not have enough precision to get all the places correct. This is not math, this is computing. All of these computing devices make compromises in the interest of doing useful work. They do useful work. The user must understand the limitations and find ways around them if they are a problem. There is a whole field called numerical analysis which finds clever ways to avoid the problems.






        share|cite|improve this answer






















          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          Back when we used handheld calculators they typically could only store $8, 10$ or $12$ decimal digits. The apps on many computers have maintained that limitation. Before that we had slide rules and could only operate with about three digits. Your multiply demands $18$ decimal digits. A computer that uses $64$ bit integers will get this right. There are many software packages that use arbitrary precision integers and they will get this right as well. A computer that uses $32$ bit integers can only do this by converting to floating point and will not have enough precision to get all the places correct. This is not math, this is computing. All of these computing devices make compromises in the interest of doing useful work. They do useful work. The user must understand the limitations and find ways around them if they are a problem. There is a whole field called numerical analysis which finds clever ways to avoid the problems.






          share|cite|improve this answer












          Back when we used handheld calculators they typically could only store $8, 10$ or $12$ decimal digits. The apps on many computers have maintained that limitation. Before that we had slide rules and could only operate with about three digits. Your multiply demands $18$ decimal digits. A computer that uses $64$ bit integers will get this right. There are many software packages that use arbitrary precision integers and they will get this right as well. A computer that uses $32$ bit integers can only do this by converting to floating point and will not have enough precision to get all the places correct. This is not math, this is computing. All of these computing devices make compromises in the interest of doing useful work. They do useful work. The user must understand the limitations and find ways around them if they are a problem. There is a whole field called numerical analysis which finds clever ways to avoid the problems.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Aug 14 at 4:59









          Ross Millikan

          277k21187353




          277k21187353




















              up vote
              0
              down vote













              That is because of register width limitation. If you want to manipulate numbers that don't fit into registers, you need to use different techniques.






              share|cite|improve this answer
























                up vote
                0
                down vote













                That is because of register width limitation. If you want to manipulate numbers that don't fit into registers, you need to use different techniques.






                share|cite|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  That is because of register width limitation. If you want to manipulate numbers that don't fit into registers, you need to use different techniques.






                  share|cite|improve this answer












                  That is because of register width limitation. If you want to manipulate numbers that don't fit into registers, you need to use different techniques.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Aug 14 at 4:52









                  dry leaf

                  1




                  1




















                      up vote
                      0
                      down vote













                      This depends on what computer and programme you use. Any supercomputer will get the right answer. Plus, you may have made an error in your pen & paper calculation.






                      share|cite|improve this answer






















                      • Use the programme GAP. It works there.
                        – Shaun
                        Aug 14 at 4:49










                      • Using a "supercomputer" doesn't necessarily guarantee a correct answer. And, conversely, a correct answer can be obtained on a very small computer if it represents numbers the right way. Number representation is the key, not the size of the computer.
                        – bubba
                        Aug 14 at 12:50














                      up vote
                      0
                      down vote













                      This depends on what computer and programme you use. Any supercomputer will get the right answer. Plus, you may have made an error in your pen & paper calculation.






                      share|cite|improve this answer






















                      • Use the programme GAP. It works there.
                        – Shaun
                        Aug 14 at 4:49










                      • Using a "supercomputer" doesn't necessarily guarantee a correct answer. And, conversely, a correct answer can be obtained on a very small computer if it represents numbers the right way. Number representation is the key, not the size of the computer.
                        – bubba
                        Aug 14 at 12:50












                      up vote
                      0
                      down vote










                      up vote
                      0
                      down vote









                      This depends on what computer and programme you use. Any supercomputer will get the right answer. Plus, you may have made an error in your pen & paper calculation.






                      share|cite|improve this answer














                      This depends on what computer and programme you use. Any supercomputer will get the right answer. Plus, you may have made an error in your pen & paper calculation.







                      share|cite|improve this answer














                      share|cite|improve this answer



                      share|cite|improve this answer








                      edited Aug 14 at 4:56


























                      community wiki





                      2 revs
                      Shaun












                      • Use the programme GAP. It works there.
                        – Shaun
                        Aug 14 at 4:49










                      • Using a "supercomputer" doesn't necessarily guarantee a correct answer. And, conversely, a correct answer can be obtained on a very small computer if it represents numbers the right way. Number representation is the key, not the size of the computer.
                        – bubba
                        Aug 14 at 12:50
















                      • Use the programme GAP. It works there.
                        – Shaun
                        Aug 14 at 4:49










                      • Using a "supercomputer" doesn't necessarily guarantee a correct answer. And, conversely, a correct answer can be obtained on a very small computer if it represents numbers the right way. Number representation is the key, not the size of the computer.
                        – bubba
                        Aug 14 at 12:50















                      Use the programme GAP. It works there.
                      – Shaun
                      Aug 14 at 4:49




                      Use the programme GAP. It works there.
                      – Shaun
                      Aug 14 at 4:49












                      Using a "supercomputer" doesn't necessarily guarantee a correct answer. And, conversely, a correct answer can be obtained on a very small computer if it represents numbers the right way. Number representation is the key, not the size of the computer.
                      – bubba
                      Aug 14 at 12:50




                      Using a "supercomputer" doesn't necessarily guarantee a correct answer. And, conversely, a correct answer can be obtained on a very small computer if it represents numbers the right way. Number representation is the key, not the size of the computer.
                      – bubba
                      Aug 14 at 12:50


                      這個網誌中的熱門文章

                      tkz-euclide: tkzDrawCircle[R] not working

                      How to combine Bézier curves to a surface?

                      1st Magritte Awards