Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Explanation pls
Message
De
07/03/2011 04:03:47
 
 
À
07/03/2011 02:03:00
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
01502561
Message ID:
01502809
Vues:
41
>>>>
>>>>So... the ToString() value actually does exceed the max.
>>>>
>>>>That was fun.
>>>
>>>No it wasn't ! I had to buy a bigger monitor :-}
>>
>>LOL it was a long number.
>>
>>in finishing off that large number lib, I ran into this:
>>
>>C#
>> ? -1000 % 3 = -1
>>
>>VFP
>> ? -1000 % 3 = 2
>>
>>Can anyone explain that one?
>
>Yes - see http://en.wikipedia.org/wiki/Modulo_operation
>
>vfp : the modulo result has the same sign as the divisor( here 3)
>C# the modulo result has the same sign as the dividend( here -1000)

Not much of a consenus between languages on that link ;-}
Also hadn't occurred to me that, as per link, this wouldn't work in C#:
bool isOdd = -3 % 2 == 1;
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform