Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating very large numbers
Message
De
09/09/2009 12:14:43
 
 
À
09/09/2009 04:19:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01423218
Message ID:
01423295
Vues:
62
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform