Sam,
| I am not able to use LONG data type as it exceeds the limit,
I would consider doing something similar to what Cor suggests, Define a
LongLong data type (an Int128 if you will) . I would consider making this
data type an immutable Structure that has two Long fields, a low order long
& a hi order long. Possible four Integers...
Then define the "operators" that I needed on it.
I would consider using C# or VB 2005 as defining the low order long as a
unsigned long would be easier...
The "trick" is going to be defining your operators, as you need to go back
to Math 101 & remember how to carry & borrow digits when you add & subtract
the numbers. Hint each of the fields (2 longs or 4 integers) represent a
"digit"...
Doing a quick google search, I found the following that may give you an idea
of how to do this.
http://blogs.msdn.com/ajenner/default.aspx
HINT: You need unchecked math, alternatively you could handle the exception
when the low digits have an overflow exception... Again unsigned for the low
digits would be easier...
Hope this helps
Jay
"Sam Fisher" <so*****@microsoft.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
| Hi,
| I have a situation where I have to support a large number(not decimals),
| something of the order of 20 to 30 digits in the database(sql server 2000)
| I am not able to use LONG data type as it exceeds the limit, so I am
| thinking of using the string value now. But do not know how to do the
| arithmetic operations on this large number, I need the simple operations
| like incrementing the number by one etc.
|
| Any help will be greatly appreciated.
|
| Sam
|
|
|
|