Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculating very large numbers
Message
De
10/09/2009 01:53:30
 
 
À
09/09/2009 12:14:43
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:
01423395
Vues:
51
Thank You :)



>>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
>
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform