LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Truncate/Mod

I've been working on this for the good portion of today and Im very baffled.
I'm probably overlooking something very simple. Anyway I need to get the mod
of some very very large numbers. So large I need to split it down into
smaller componants just to load it into a double (Im doing this all for fun.
I just really want to figure this out because there must be a way). Anyway,
so I've split the number into a much smaller number 1.9923E+130
approximately. I need to mod this number by a variable that can reach well
into the 60,000s. Unfortunately as far as I can tell the Mod operator is
only capable of returning an integer. I believe integers can only go up to
16k or 32k.

Right now building and testing the program Im modding this 1.9923E+130 by
17947. I keep getting a variable overflow message. I've attempted to write
my own Mod function which needed its own Truncate function (Does VBA even
that the ability to truncate?!). It works find on smaller numbers.
Something well into the quintillians I believe. But when it faces by
1.9923E+130 my truncate function returns a 1. Okay, well my truncate
function is probably doing it all wrong. Its basically:

Arr = Split(number, "."
trunc = Arr(0)

My Mod function is something along the lines of:

number = number / divisor
TruncNum = trunc(number)
fMod = (number - TruncNum) * divisor

So if anyone has any suggestions or sollutions please let me know. If
pursuing this little project of mine is just rediculous please let me know
too. I've been having fun thusfar minus the arteries which may have ruptured
in my head. Blah.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Truncate Elizabeth Excel Discussion (Misc queries) 4 November 18th 09 09:50 PM
How do you truncate 2.22 to just 0.22? Crackles McFarly Excel Worksheet Functions 6 September 5th 07 01:14 AM
How do I truncate something like this? ckeys Excel Discussion (Misc queries) 6 December 30th 06 05:49 PM
truncate tamar Excel Worksheet Functions 1 July 19th 05 10:32 PM
Truncate Steven Excel Programming 11 April 20th 04 12:11 PM


All times are GMT +1. The time now is 11:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"