vb.net overflow of variable as in c#

0

I need to make some big multiplications for cryptographic reasons in vb.net and overflow the variable as C,C++ and C# does. I have disabled the check of overflow at the vb.net project but when i an doing those multiplications i get as a result 1.#INF

ex. in c:

z^y= 0xFFFFFFFF ^ 0x000003FC= 0xFFFFFC03

in vb.net:

z^y= 0xFFFFFFFF ^ 0x000003FC= 1.#INF

is it possible to be done?

vb.net
cryptography
overflow
asked on Stack Overflow Mar 19, 2012 by Reven

1 Answer

6

^ in C is Xor in VB and should never be able to overflow.

On the other hand, if you write ^ in VB then this is assumed to be the “power” operation.

Dim z = &HFFFFFFFF
Dim y = &H000003FC
Dim x = z Xor y
answered on Stack Overflow Mar 19, 2012 by Konrad Rudolph

User contributions licensed under CC BY-SA 3.0