Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integer overflow exception at absOptimization..ctor() #9

Closed
Worldexe opened this issue Mar 10, 2017 · 1 comment
Closed

Integer overflow exception at absOptimization..ctor() #9

Worldexe opened this issue Mar 10, 2017 · 1 comment
Assignees
Labels

Comments

@Worldexe
Copy link

Namespace Optimization
    ...
    Public MustInherit Class absOptimization
        ...
        Protected m_rand As System.Random = New clsRandomXorshift(CUInt(Environment.TickCount))

Environment.TickCount can actually return negative number (it does at my machine).

There should be
Protected m_rand As System.Random = New clsRandomXorshift(BitConverter.ToUInt32(BitConverter.GetBytes(Environment.TickCount), 0))

@tomitomi3 tomitomi3 self-assigned this Mar 11, 2017
tomitomi3 added a commit that referenced this issue Mar 11, 2017
@tomitomi3
Copy link
Owner

Thank you for finding the bug. When a negative number is an argument, exception is raised.
I fixed absOptimization in your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants