Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Very big value for CRC32
Message
From
12/08/2011 08:04:15
 
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01520761
Message ID:
01520813
Views:
41
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform