ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Just because you don't get a reply in an hour doesn't mean we're ignoring you. *I* had a server with a disk failure I had to take care of. That takes priority.
How do you want to make the number 'smaller'? In what way? In representation? In value?
Maybe you could give a small example of what you want to do.
And a personal remark (because I don't understand what you want I might not answer your question).
If you have a 300k file (this is the size on disk), the biggest number you could store would be 2 at the power 300*1024*8 that is 2 at the power 2457600. This would be the case when you would use binary enconding.
Example:
The number 255 in base 10 is 255 -> in ascii would be 0x32 0x35 0x36 -> on disk would be 0011 0010 0011 0101 0011 0011 -> 3 bytes
The number 255 in base 16 is ff -> in ascii would be 0x66 0x66 -> on disk would be 0110 0110 0110 0110 -> 2 bytes
The number 255 in computer memory is 1111 1111 -> written directly on disk (no conversion to ascii) would be 1111 1111 -> 1 byte
As I said, if this doesn't help and you want aid, you must ask a complete question and maybe give an example too.
I *MAY* be understand the original question, but I am not sure, as it does not seem to make sense to me.
I believe he's saying that since 300kb of hex data can be stored as 150kb in binary, "can that process be repeated to reduce it to 75kb?" The answer is, of course, no. Hex digits have 4 "significant bits", which means 2 hex digits are the same as 1 byte in binary. This cannot be repeated, since all 8 bits are now significant.
if increase u use binary as the base....u can converter that to a base 10 number......ok but if u convert it to base 100 does the size still decrease remember u need to use 100 symbols to represent in the end result so the resulting file is half plus 100 bytes
ok just a question how are u converting a base to base
anywayz u got a serious of 1 and 0s u pair them off to 2 different values
e.g 01 is 1 and 10 is 0........ok u run thru the file once ........u not lost any information as u just reverse the process
but thats only halfing it in one process
i dont want to obey there rules...i have a 150 file representing a number....
all i do is half that number
i still can get to 300k
but i want to know how to traverse the power of 2.......e.g so i can say convert me base number into binary numbers
rigth now tell me what that binary number is if it was in base n
or what method can i applie to n to reversed down to binary
just off topic...if u applied every 0 and 1 in to a program that asked for just the output of a given electronic circuit, we should end up with a really smal number of 0 and 1s....but that could recalculate a bigger number just say this is the 0 and 1s of the out put that i had
but remember we still have 0 and 1s....they can be knocked down further if u do the same with those numbers
but u would get a differnt result if u used differnt numbers....
as u are not finding a unique number...u just using a unique number and tranversing down it calculation
and using a multiply of that calculation to get back to that number u wanted
any number can be switch to a higher number in its own sequence
now all i would do is tell program to read n
ok ill just an show u what i want
let a = input
if a = odd number the subtract 1 else a/2
write 1 or 0 to file e.g. if was odd the write 1 if was even write 2
so u just did this....
no say u got this number 01010101001010101001
now that represents how many times u can multipley by 2 nd if u need to add 1
and depends when u wanted to stop is entirely up to u
repeat
i wuld love to travesre the prime bases
ok we can go back to creating only one outcome.....using the least information
.
ok i do a process that is reverisble...the process i do will result ina small number.....
that number u can use to get back to my number
e.g i keep halfing in the method i explains recording all the numbers...that means i have a base number whixh is the size of binary representation dont i yes i know it not much of a reduction when u only do it once..but if u keep finding the next binary representation just for that number
e.g by doing the same calculation u get the same ratio dont u
i just want to know how to calculate the ratio and give u a number like 14 and make it mean something to another number i chosen for u to have
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.