Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Very big value for CRC32
Message
De
12/08/2011 08:04:15
 
 
À
12/08/2011 04:50:55
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01520761
Message ID:
01520813
Vues:
38
>All that matters is the 32 bit pattern held by the integer. It does not matter whether you use Int32 of UInt32 to hold the value - bitwise operations never cause an overflow.
>As long as the types you use for the comparison are the same (i.e. both Int32 or both UInt32) it will work. Actually, in VB.NET I think you can do bitwise operations on a mix of types. e.g:
Dim i As Int32 = 16777215
>Dim u As UInt32 = i
>Dim Match As Boolean = (i Xor u) = 0
So, a CRC32 calculation can return a value higher than an integer. Is that correct? And, even if the property is declared integer, this wouldn't create an overflow. This is why the program didn't generate an error at calculation time. But, it did generate an error at SQL query time as at that location, we have to build our query with the same type as the type in the table.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform