Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Factors
Message
 
 
À
07/02/2008 10:53:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01290395
Message ID:
01290424
Vues:
16
Hi Jos,

Or simpler :)
? FLOOR(SQRT(lnNumber)), CEILING(lnNumber/FLOOR(SQRT(lnNumber)))
>
>Thats pretty close and works most of the time. 7 does not work. But I could double check the lower x higher factors and if the result is under the original number, increment the lower value. What do you think?
>
>
>>Jos,
>>
>>Try
>>
>>? FLOOR(SQRT(lnNumber)), CEILING(SQRT(lnNumber))
>>
>>
>>>
>>>Given an integer, how do I find the 2 highest factors that produce that exact integer or the next nearest higher integer? i.e.
>>>
>>>1) Given 50 I would like 7 & 8 = 54. (7 x 7 = 49 would be too low)
>>>
>>>2) Given 36 I would like 6 & 6.
>>>
>>>Any easy calculation for that?
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform