Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check for ***********************
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00389944
Message ID:
00390227
Vues:
10
>>Since you are discussing division by zero I was wondering if anyone can comment on the best or prefered way, to display an undefined value if the display is numeric?
>>Is it better to ;
>>
>>a) display 0 (zero) for the value
>>b) assume the denominator is 1 (one) and display the numerator
>>c) ??
>>
>Isaac,
>
>I've always felt that division by zero, in most cases, is represents a lack of data validation on the part of the developer. However, I've also run across instances where, for various and sundry reasons it might not be. Having said that, it really depends on the situation. I have, depending on the circumstance, allowed the "****" to be displayed, displayed zero, or displayed nothing. It just depended on the requirements.


I am currently working on some reports that compare periodic data. If there is no data for the previous period(s), then of course the percentage difference is undefined. In this situation I will try to display a string such as "Prev Data NA", but I agree that there is no simple rule.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform