$123456789123456789 times 2$ [closed]

Clash 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 :)
arithmetic
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.
 |Â
show 1 more comment
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 :)
arithmetic
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
 |Â
show 1 more comment
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 :)
arithmetic
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 :)
arithmetic
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
 |Â
show 1 more comment
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
 |Â
show 1 more comment
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.
add a comment |Â
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.
add a comment |Â
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.
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
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
answered Aug 14 at 4:59
Ross Millikan
277k21187353
277k21187353
add a comment |Â
add a comment |Â
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.
add a comment |Â
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.
add a comment |Â
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.
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.
answered Aug 14 at 4:52
dry leaf
1
1
add a comment |Â
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
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.
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
add a comment |Â
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
add a comment |Â
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