Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating very large numbers
Message
From
09/09/2009 12:14:43
 
 
To
09/09/2009 04:19:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01423218
Message ID:
01423295
Views:
61
>Dear All
>
>Is there any way to make precise calculation without number being rounded
>
>? 22919090710007290*100/97
>
>Returns rounded number. I need actual remainder.
>Mod(22919090710007290*100,97) returns 0
>
>What are the options.
>
>TIA
>Sergio

with 9223372036854775807 bound you can use this:
? ModEx("2291909071000729000",  97)
? ModEx("2291909071000729100",  97)

FUNCTION ModEx(lcNumber, lnDivisor)

    LOCAL ly
    ly=CAST(TRANSFORM(m.lcNumber,"@R 999999999999999.9999") AS Y)
    RETURN ((m.ly-INT(m.ly/m.lnDivisor)*m.lnDivisor)*10000)%m.lnDivisor
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform