Re: maximum integer length?



On 2006-06-18, Sybren Stuvel <sybrenUSE@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
nate enlightened us with:
Obviously I didn't have enough memory for that, but I was able to c**3.
(I think anyways, it is still trying to display the result)

So I am just wondering how long an integer can be with 400 megabytes of
memory.

I guess the best way would be a binary search for the proper value of
the integer. You already have an upper (c**d) and a lower (c**3) bound
for your search.

each integer takes up a byte right?

That depends on the size of the integer, doesn't it?

If I have 400 megabytes that would mean I could have a long integer
with up to 419,430,400,000 integers?

Que? An integer is just a whole number without fraction. What are you
talking about?

He's talking about decimal digits. Each decimal digit takes up
3.322 bits. A byte can hold about 2.4 digits. 400MB should be
able to hold an integer with about 1,010,000,000 decimal
digits.

--
Grant Edwards
grante@xxxxxxxx
.



Relevant Pages

  • RE: BoundField and DataFormatString in ASP.NET 2.0 - Bug ?
    ... I have turned one column display invisible but left its header visible. ... > formatted with the Euro sign and 2 decimal digits. ... > formatted like price 3 with Euro sign and with varying decimal digits. ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Fast Linear Hex Search
    ... And for search purposes, since you search on decimal digits, it would be great to put them all in a hash (since memory shouldn't be a problem) like that: ... Then sort the hash on the values and you would easily be able to compute stats like how many 4's are there?, how many times are identical consecutive digits encountered?, etc. ...
    (comp.lang.perl.moderated)
  • Re: Price Data Formatting
    ... I suggested that instead of looking for the number of decimal digits that MOST of the data items use you should instead, with the specific "rider" I mentioned, look for the MAXIMUM number of decimal digits in the data list. ... What I AM arguing with is your suggestion regarding how you should initially decide on how many decimal digits you need to display. ...
    (microsoft.public.vb.general.discussion)
  • Re: Task Duration
    ... to input duration in minutes. ... but if you did it via an Excel spreadsheet, you can display any number ... of decimal digits you want. ... > entry to the nearest 15 minutes and simplify billing. ...
    (microsoft.public.project)
  • Re: PL/I GCC
    ... |>> what do you mean by true decimal float? ... There was a limit of 20 digits for products and quotients, which went into a fixed area of core from 00080 to 00099. ... I think the Model II could have up to 100,000 decimal digits. ... The architecture of both the Mod I and the Mod II accommodated up to 100,000 decimal digits of memory, but no more than 60,000 ever seems to have been physically configurable. ...
    (comp.lang.pl1)