Long Numbers: Unexpected Results

  • Mathematica
  • Thread starter mas1o
  • Start date
  • Tags
    Numbers
In summary, long numbers are numbers with a large amount of digits, often more than 15. They can be integers, decimals, or fractions. Due to limitations in computer processing, long numbers may produce unexpected results. Specialized programming techniques, such as using libraries or breaking down the number, can help avoid these issues. Despite their limitations, long numbers are used in various fields, including cryptography, astronomy, and finance.
  • #1
mas1o
1
0
hello

i try add 1204812635653636...a really long number...4235345345667 to 534095083405834058...long too...5703457034953. everything is ok, but my result is 8234823635636365464560000...and few pages with only 000000000000000000.


what happend?

ps all numbers is only for example.
 
Physics news on Phys.org
  • #2
How about forwarding this to Wolfram? They should be able to give you an accurate answer.

Cheers
Vivek
 
  • #3


It seems like you may have encountered an issue with precision and rounding when working with long numbers. In computer science, there is a limit to the number of digits that can be accurately represented in a number, and this can lead to unexpected results when working with extremely large numbers.

One possible solution to this problem is to use a data type that can handle larger numbers, such as a Big Integer or Big Decimal. These data types have built-in methods for handling large numbers and can help prevent rounding errors.

Another solution could be to break down the long numbers into smaller chunks and perform the calculations separately. This can help prevent any loss of precision and ensure more accurate results.

It's also important to keep in mind that computers are not perfect and can sometimes make mistakes when working with numbers. It's always a good idea to double-check your calculations and results to ensure their accuracy.

In conclusion, encountering unexpected results when working with long numbers is not uncommon, but there are ways to mitigate this issue. By using appropriate data types and techniques, we can ensure more accurate and reliable results.
 

1. What are long numbers?

Long numbers are numbers that contain a large amount of digits, typically more than 15 digits. These numbers can be integers, decimals, or fractions.

2. Why do long numbers sometimes produce unexpected results?

Long numbers can produce unexpected results due to the limitations of computer processing. Computers have a finite amount of memory, and when dealing with extremely large numbers, they may not be able to accurately represent the entire number, leading to unexpected results.

3. Can long numbers be accurately represented on a computer?

In most cases, long numbers cannot be accurately represented on a computer. However, there are specialized programming languages and techniques that can handle extremely large numbers, such as using libraries that support arbitrary-precision arithmetic.

4. How can I avoid unexpected results when working with long numbers?

To avoid unexpected results when working with long numbers, it is important to understand the limitations of computer processing and use appropriate programming techniques to handle these numbers. This may include using specialized libraries or data types, breaking down the number into smaller parts, or using scientific notation.

5. Are there any real-world applications for long numbers?

Yes, long numbers are used in various fields such as cryptography, astronomy, and physics. They are also commonly used in financial calculations, such as calculating interest on large loans or tracking stock market prices.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • Programming and Computer Science
Replies
12
Views
11K
  • Aerospace Engineering
Replies
3
Views
3K
  • Electrical Engineering
Replies
12
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
862
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Replies
3
Views
265
Replies
5
Views
421
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
Back
Top