[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
numbers bigger than uint32 / uint64
From: |
k bah |
Subject: |
numbers bigger than uint32 / uint64 |
Date: |
Sun, 24 Jun 2007 05:26:36 +0800 |
Hi,
I use octave, but all I write has to work on matlab too. On octave I can do
some operations with uint64 that I cannot do on matlab. Because of that I use
uint32. I only want to do these operations: a) convert to string b) convert
from string c) sum d) reverse the number ( 143 -> 341) while it's on a form of
a string
When my numbers (all positive integers) overflow uint32 capacity, my for()
loop stops, and a message is shown. I could:
1) use the binary representation of the number, then the limit would be (in
theory) the available memory (since I would be using a matrix), the problem
here is:
...1a) How can get the binary representation of the inverted number? reverse
the binary matrix will not give me that
...1b) What's the algorithm to sum binary numbers, knowing they are stored on
a vector, as I get from dec2bin().
2) use the decimal representation of the number, but store it on a matrix,
each digit on a position in the matrix
...2a) How to get digit by digit from my decimal? If the number is stored on a
string, then it's ok, but how to do it when it's on a integer variable?
...2b) the algorithm to add the decimal numbers, given the fact they're stored
on the above matrix and they exceed the uint32 capacity (so I cannot get the
entire matrix back to an integer, just work with each digit on each position).
thanks
=
Envelopes - Plain and Printed
Millions of envelopes and sheets in stock. Manufacturing a complete line of a
brand envelopes. Up to four color printing including process on envelopes and
matching letterheads.
http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=3f0db6d2099a6db4a5f019336a9ee758
--
Powered by Outblaze
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- numbers bigger than uint32 / uint64,
k bah <=