Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15695

VS 2017 VB .Net Different Arithmetic Result in Two Apps

$
0
0
i have a compiled Vb .Net Program that have below Arithmetic line when i want to use this line in new App has different result the code is :

Code:

Protected Sub MethodOne(ByRef A_1 As UInteger,A_2 As UInteger,A_3 As UInteger,A_4 As UInteger,A_5 As UInteger,A_6 As UShort)
A_1 = A_2 + Class2.Method1(A_1 + ((A_2 And A_3) Or (Not A_2 And A_4)) + 127, A_6)
    End Sub

'====================== method in Class2 difinition ====================
Code:

        Public Shared Function Method1(A_0 As UInteger, A_1 As UShort) As UInteger
                          Return A_0 >> CInt((32US - A_1)) Or A_0 << CInt(A_1)
        End Function

=================================================

with predefined values as

A_1 = 1732584193UI

A_2 = 4023233417UI

A_3 = 2562383102UI

A_4 = 271733878UI

A_5 = 0

A_6 = 7

A_7 = 0

when i Call MethodOne in Compiled App the Result of MethodOne is

A_1 2770347892 uint
but when i Run Same Code in New App With Same A_1 to A_6 Values the Result is

A_1 4023249673 uint
notice : in both Assembly i have turned on RuntimeCompatibilityAttribute:WrapNonExceptionThrows=true

What i have mistake ?

regards

Viewing all articles
Browse latest Browse all 15695


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>