-
Notifications
You must be signed in to change notification settings - Fork 276
arithmetic exception at nupic::Random::getUInt32(unsigned int) #1410
Comments
That is strange. Is this something you can write a little code to replicate? or better yet a unit test? |
|
But we have a problem in release mode, where the inputs lie is zero |
If you need that check to be compiled in release mode then you could replace the |
Yes, I believe the correct approach is NTA_CHECK, as modulo 0 does not make sense. |
We should stick with NTA_ASSERT. There's no reason to slow down the Release code with this check, especially since the function will already crash if max = 0. What's the benefit of making the program crash one line sooner? The purpose of this NTA_ASSERT is really just code readability. |
@lscheinkman could you explain the motivation for the |
The Regarding this issue, I don't think there's any fix needed. The NTA_ASSERT is serving its purpose. |
@lscheinkman @mrcslws : For debugging problem with getUInt32(), today I successfully compile both nupic_core and htmresearch-core in debug mode and release as mentioned in the README. So I can compile and run my application in release mode. BUT in the debug mode, I always have a linking error to debug library like: I really do not understand, why the constructor of TemporalMemory is disabled in debug mode? Do you have any idea? |
sometimes I had this exception
in the function in the file Random.cpp:
Because here the value of
max = 0
, so that I believe thatNTA_ASSERT(max > 0)
does not work correctly, but why?Do you have any idea?
thanks.
The text was updated successfully, but these errors were encountered: