473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there any algorithm which can shorten a certain very large big integer?

2 New Member
Hi Everybody,
This is the first time I have ever posted a question so I may not be familiar with the pattern to adopt. Hereunder my problem goes.


I have a function which generates a very large Integer (I do this by using Biginteger from vjslib.dll and I am able to operate all kind of arithmetic operators on such a biginteger.)

But, My goal is to shorten this biginteger into a small integer. Is there any algorithm? or a mathematical Formula which I can use to represent it in a small integer and use some reverse formula to get the original Biginteger?

The big integer my function creates goes like this:
98761210112313489375987956157462364864823458794572 34573485683465868234568613123749081377932457923457 93475897836587236458678234568234658362458762347895 68932456892346578636123846715376123475745723645666 38247687346128346812364812364816341384612384678345 76341236412783461278346781236481263489126348971238 41134681273467812364789

I do not want to represent my bigInteger in a higher base as it will not be possible to do conversion into higher bases with such a large integer.

Anyone who can help me out with this question, I shall be very thankful to him.
Dec 8 '10 #1
2 3437
Stewart Ross
2,545 Recognized Expert Moderator Specialist
Hi. As far as I know it is not possible to transfer your very large number to an equivalent smaller whole-number container of some kind unless you change the number's base, which you've already said you cannot do.

It may well be possible to compress your large number using a compression algorithm to shorten and replace combinations of digits, but the end result would not be a smaller integer as such, but a coded representation of the larger value. This encoded value would not be a numeric value as such, but a compressed representation of a numeric value whose components will depend on the compression algorithm used. As this is not what you have asked for in your question I'd have to answer that it is not possible to create a 'smaller' true numeric representation of your large number without loss of information unless you go the base-change route that you've already ruled out.

If your big integer value is generated as a text string then you can of course parse this down and extract the individual components into a long-integer array or similar, but as your question relates to converting whole number to whole number I'll leave this one as a possibility for you to consider in due course.

-Stewart
Dec 8 '10 #2
Atiq ur Rehman
2 New Member
Mr. Stewart. Thank you so much for putting your efforts on elaborating my concern.

Stewart, I think the only possibility in achieving small whole number or array of small whole numbers out of a large string of numbers is to use combinations algorithm. These days I am studying the Fibonacci Number series and trying to incorporate it's logic somewhere in my algorithm.

Stewart, i am also interested to parse this down to extract individual components into a long-integer array or similar. Can you provide me some coding pastern/examples to start with?

Again I am so thankful to you for your kind advises on this matter.
Dec 27 '10 #3

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

Similar topics

0
1146
by: Scott Seidman | last post by:
I have a data file structure that I am consistently confined by. I'm considering alternatives, and a self-defining markup is one of them. The problem is that this file consists of some header...
4
1992
by: LBX | last post by:
I am looking for C++ libraries that handle very large integers. The purpose of the large integers are to handle RSA algorithms. So I need to be able to multiply, power, and modulus. Having one...
2
2631
by: Matthew Holton | last post by:
Hello All, I am looking to convert a currency data type to a large_integer. Thanks in advance
42
3297
by: yong | last post by:
Hi all I have an large integer in this format x1*256^5 + x2*256^4 + x3*256^3 + x4*256^2 + x5*256 + x6 now I must convert it to this format y1*900^4 + y2*900^3 + y3*900^2 + y4*900 + y5 x1-x5...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7084
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
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
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
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.