473,394 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Division with precision of 10,000 decimal digits

polterbyte
Hi.

I need to make a series of divisions with a precision of 10,000 decimal digits (or larger). I believe the best way to achieve this is with a linked list, with each node holdings six orders of magnitude more than the predecessor node, and so forth. Thus, the division of, say 1/9753, which yields a period 3250 digits long can be represented in its totality in the data structure, a few times over.

Can anyone suggest an algorithm that would work on these conditions? (Or point me in the direction of a similar solution already posted here?)

Thanks!
Jun 29 '18 #1
1 1884
weaknessforcats
9,208 Expert Mod 8TB
There are several "big number" libraries already written that you can purchase.


Some store large values in strings and write code to do math on the strings. Others allocate memory (as you would in a string) and use the bits for the values. Again writing code to make this happen.

I recommend acquiring a commercial library rather than spending a ton of time creating one in your own vision.


Start by doing a google on "C++ very big numbers".
Jun 30 '18 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing/modifying the code. Thank you. .. Facundo
3
by: Bei | last post by:
I have variable, say "total". It can be an integer or floating number. No matter what value it stores (5 or 5.1 or 5.24), when I display it, is there a way I can make it display it with fixed 2...
5
by: Mattias Brändström | last post by:
Hello! I am trying to find a minimal class/lib that handles arbitrary precision decimal numbers. I would be happy if this class supported as little as addition, subtraction, multiplication,...
3
by: James Foreman | last post by:
I'm using DB2 UDB 8.1.2 on Suse linux. Try this: CREATE TABLE testsums (cost_of_sale decimal(7,2), price decimal(9, 2)); INSERT INTO testsums VALUES (10000, 30000); SELECT cost_of_sale/price...
9
by: shk253 | last post by:
I've been asked to write a program that calculates the total time worked. I use struct to create variable type time1, and ask the user to enter time in and time out. I convert both to seconds and...
10
by: Artemio | last post by:
Hello all! I just stumbled across a weird problem with precision of a division operation. I am on Mac OS X, GCC 4.0.1. Say I have two float or double numbers, and I want to divide one by...
1
by: OmidLeo | last post by:
Hi All, A very simple but confusing problem, I've now a lot of calculations in stored procedures that are all inaccurate!, e.g 1234567890 * (1.0 - 0.5/14.0) the result is actually...
3
by: Ethan Furman | last post by:
Hey all. My thanks to all who have responded so far with my other questions. It is much appreciated. Some background on what I'm doing (a good explanation can be found at...
4
dlite922
by: dlite922 | last post by:
I have a query with number fields that contain floats with zero to three decimal places. When I SUM even just two of them together the sum() field fills up the precision up to the float max value. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.