MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Printing Large Base-n Numbers


You can display a 16-base number with the ToString-Function. Here is a
sample notebook:

In[126]:=
p =
11354882100554070846945886900376612381887314805411070198522440388172296396\
4066445293488918726487884165751915105884395208557100959738769115073161568342
54\
673;

In[127]:=
displayHexNumber[p_Integer] := Module[{a, b, c},
    a = ToString[BaseForm[p, 16]];
    b = StringPosition[a, " "];
    c = {b[[1, 1]], b[[Length[b], 2]]};
    StringDrop[a, c]]

In[128]:=
displayHexNumber[p]

Out[128]=
"d8cd81f035ec57efe822955149d3bff70c53520d769d6d76646c7a792e16ebd89fe6fc5b606
b5\
6f63eb11317a8dccdf203650ef28d0cb9a6d2b2619c52480f51\n16"


<Flip at safebunch.com> schrieb im Newsbeitrag
news:9imc9t$ev7$1 at smc.vnet.net...
> Hi All,
>
> when converting bases for large numbers, such as:
>
> p =
11354882100554070846945886900376612381887314805411070198522440388172296396\
>
4066445293488918726487884165751915105884395208557100959738769115073161568342
54\
> 673;
>
> BaseForm[p, 16]
>
> The output of baseform is a long (with no wrapping) string.  When one
prints
> this out, it gets cut off of the page.
>
> Is there a way to be able to see the hex (and actually treat it is a
number do
> you can print results) output as a nicely formatted hex number?
>
> (My main concern is to printout results for the audience).
>
> Thank you for any input ... Wilson
>
>




  • Prev by Date: Re: Capability of Mathematica
  • Next by Date: Re: weighting CA neighbors by distance
  • Previous by thread: Printing Large Base-n Numbers
  • Next by thread: Head found ;-)