Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Integer division in c#
Message
De
05/07/2011 07:06:08
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01517283
Message ID:
01517286
Vues:
55
>Is there an integer Function in C#
>
>(VFP Code)
>Int(201106 / 100) ....... Returns 2011
>Int(201107 / 100) ........ Returns 2011
>
>(In above examples , 201106 and 201107 are both integers
>
>Tia
>Gerard


If both operands ( 201106 and 100) are integer then the result will be integer -

Otherwise you can
- use Math.Floor(201106.0 / 100.0)
- cast it to integer
  int result = (int)(201106.0 / 100.0)
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform