dbTalk Databases Forums  

What´s the algorithm that compresses a 20 digit big int, into 8 bytes ?

comp.databases.theory comp.databases.theory


Discuss What´s the algorithm that compresses a 20 digit big int, into 8 bytes ? in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rafael Anschau
 
Posts: n/a

Default What´s the algorithm that compresses a 20 digit big int, into 8 bytes ? - 03-24-2010 , 08:28 AM






Does anybody knows ?

Thanks

Reply With Quote
  #2  
Old   
Bob Badour
 
Posts: n/a

Default Re: What´s the algorithm that compresses a 20 digit big int, into 8 bytes ? - 03-24-2010 , 08:38 AM






Rafael Anschau wrote:

Quote:
Does anybody knows ?

Thanks
Multiply by 10 and add digit; repeat

That's neither a database nor a theory question, though.

Reply With Quote
  #3  
Old   
Rafael Anschau
 
Posts: n/a

Default Re: What´s the algorithm that compresses a 20 digit big int, into 8 bytes ? - 03-24-2010 , 09:49 AM



On Mar 24, 11:38*am, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:
Quote:
Rafael Anschau wrote:
Does anybody knows ?

Thanks

Multiply by 10 and add digit; repeat

That's neither a database nor a theory question, though.
Asking what algorithm a database uses internaly is a database
question.

Reply With Quote
  #4  
Old   
Bob Badour
 
Posts: n/a

Default Re: What´s the algorithm that compresses a 20 digit big int, into 8 bytes ? - 03-24-2010 , 10:02 AM



Rafael Anschau wrote:

Quote:
On Mar 24, 11:38 am, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Rafael Anschau wrote:

Does anybody knows ?

Thanks

Multiply by 10 and add digit; repeat

That's neither a database nor a theory question, though.

Asking what algorithm a database uses internaly is a database
question.
The database implementation is likely to just call a procedure or
function akin to atoi.

Reply With Quote
  #5  
Old   
Rafael Anschau
 
Posts: n/a

Default Re: What´s the algorithm that compresses a 20 digit big int, into 8 bytes ? - 03-24-2010 , 10:58 AM



On Mar 24, 1:02*pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:
Quote:
Rafael Anschau wrote:
On Mar 24, 11:38 am, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Rafael Anschau wrote:

Does anybody knows ?

Thanks

Multiply by 10 and add digit; repeat

That's neither a database nor a theory question, though.

Asking what algorithm a database uses internally is a database
question.

The database implementation is likely to just call a procedure or
function akin to atoi.
It actually converts to binary. Just found out somewhere else, in case
someone is interested in how databases implements this particular
feature.

Reply With Quote
  #6  
Old   
Bob Badour
 
Posts: n/a

Default Re: What´s the algorithm that compresses a 20 digit big int, into 8 bytes ? - 03-24-2010 , 11:24 AM



Rafael Anschau wrote:

Quote:
On Mar 24, 1:02 pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Rafael Anschau wrote:

On Mar 24, 11:38 am, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Rafael Anschau wrote:

Does anybody knows ?

Thanks

Multiply by 10 and add digit; repeat

That's neither a database nor a theory question, though.

Asking what algorithm a database uses internally is a database
question.

The database implementation is likely to just call a procedure or
function akin to atoi.

It actually converts to binary. Just found out somewhere else, in case
someone is interested in how databases implements this particular
feature.
My apologies. The "converts to binary" part was so obvious I didn't
think of it as an algorithm. I guess I lost the forest among the trees.

Reply With Quote
  #7  
Old   
Cimode
 
Posts: n/a

Default Re: What´s the algorithm that compresses a 20 digit big int, into 8 bytes ? - 03-24-2010 , 05:12 PM



On 24 mar, 17:58, Rafael Anschau <rafael.ansc... (AT) gmail (DOT) com> wrote:
Quote:
On Mar 24, 1:02*pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:





Rafael Anschau wrote:
On Mar 24, 11:38 am, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Rafael Anschau wrote:

Does anybody knows ?

Thanks

Multiply by 10 and add digit; repeat

That's neither a database nor a theory question, though.

Asking what algorithm a database uses internally is a database
question.

The database implementation is likely to just call a procedure or
function akin to atoi.

It actually converts to binary. Just found out somewhere else, in case
someone is interested in how databases implements this particular
feature.
Encoding and algorhithmics are not synonyms.

Reply With Quote
  #8  
Old   
Sampo Syreeni
 
Posts: n/a

Default Re: What´s the algorithm that compresses a 20 digit big int, into 8 bytes ? - 04-08-2010 , 08:57 AM



On Mar 24, 8:24*pm, Bob Badour <bbad... (AT) pei (DOT) sympatico.ca> wrote:

Quote:
My apologies. The "converts to binary" part was so obvious I didn't
think of it as an algorithm. I guess I lost the forest among the trees.
Unless my trusty old TI-86 is losing precision in embarrassing places,
I should also add that 64 bits doesn't quite suffice for 20 decimal
digits; it has 18 per cent or so of the total range, so you'd have to
go with 19 digits or three extra bits.
--
Sampo

Reply With Quote
  #9  
Old   
Rafael Anschau
 
Posts: n/a

Default Re: What´s the algorithm that compresses a 20 digit big int, into 8 bytes ? - 04-09-2010 , 09:36 AM



On Apr 8, 10:57*am, Sampo Syreeni <de... (AT) iki (DOT) fi> wrote:

Quote:
Unless my trusty old TI-86 is losing precision in embarrassing places,
I should also add that 64 bits doesn't quite suffice for 20 decimal
digits; it has 18 per cent or so of the total range, so you'd have to
go with 19 digits or three extra bits.
--
Sampo
Indeed. So a few hypothesis:

1) Another algorithm is being used.
2) 72 bits are being used, and vendors are claiming 64 for marketing
purposes, the justification is that 67 is closer to 64 than 72,
notwithstanding the fact that 67 bits require full 72 bits on machines
with a byte size of 8.

There may of course be other hypothesis, thanks for bringing up this
very interesting fact.

Reply With Quote
  #10  
Old   
Bob Badour
 
Posts: n/a

Default Re: What´s the algorithm that compresses a 20 digit big int, into 8 bytes ? - 04-09-2010 , 09:45 AM



Rafael Anschau wrote:

Quote:
On Apr 8, 10:57 am, Sampo Syreeni <de... (AT) iki (DOT) fi> wrote:


Unless my trusty old TI-86 is losing precision in embarrassing places,
I should also add that 64 bits doesn't quite suffice for 20 decimal
digits; it has 18 per cent or so of the total range, so you'd have to
go with 19 digits or three extra bits.
--
Sampo


Indeed. So a few hypothesis:

1) Another algorithm is being used.
2) 72 bits are being used, and vendors are claiming 64 for marketing
purposes, the justification is that 67 is closer to 64 than 72,
notwithstanding the fact that 67 bits require full 72 bits on machines
with a byte size of 8.

There may of course be other hypothesis, thanks for bringing up this
very interesting fact.
Does your big int support the full 20 decimal digit range, or does it
merely require 20 digits to represent the extrema of the range? From
your original question, I assumed the latter not the former.

If it support the full 20 decimal digit range, no algorithm will fit it
into 64 bits so choosing a different algorithm will achieve nothing.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.