Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating very large numbers
Message
 
To
09/09/2009 12:12:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01423218
Message ID:
01423297
Views:
57
>check the GetReminder lnNumber parameters, the external are equal to internal ?
>22919090710007299*100 is 2291909071000729000 ?


Yep:
CLEAR

lnNumber1 = (22919090710007290*100.0)
? lnNumber1
GetReminder(lnNumber1,  97)
?

lnNumber2 = (22919090710007290*100.0)
? lnNumber2
GetReminder(lnNumber2,  97)
?

lnNumber3 = (22919090710007299*100.0)
? lnNumber3
GetReminder(lnNumber3,  97)
?

FUNCTION GetReminder(lnNumber, lnDividor)

    LOCAL lcString, lcOstatak, lcOneSymb, lnFor
    lcString = ALLTRIM(STR(lnNumber,200))
    ? ALLTRIM(lcString), lnNumber
    m.lcOstatak = []
    DO WHILE NOT EMPTY(m.lcString)
       m.lcOneSymb = VAL(m.lcOstatak + LEFT(m.lcString,1))
       m.lnFor     = INT(m.lcOneSymb/lnDividor)
       m.lcOstatak = TRANSFORM(INT(m.lcOneSymb - m.lnFor*lnDividor))
       m.lcString  = SUBSTR(m.lcString,2)
      * ? m.lcOneSymb, m.lnFor, m.lnFor*lnDividor, [   1111    ]+m.lcOstatak
    ENDDO
RETURN m.lcOstatak
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform