-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix compilation errors for rgeoda #5
Conversation
Signed-off-by: Xun Li <[email protected]>
Signed-off-by: Xun Li <[email protected]>
: (unsigned long long)(((unsigned long long)nextLong() >> 32) * n) >> 32); | ||
return r; | ||
return r < 0 ? 0 : r; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lixun910 Here the algorithm will return -1 in some cases, which is not correct. I need to check why this happens. But this should fix the issues that some functions calling nextInt()
crashes rgeoda, see GeoDaCenter/rgeoda#39 GeoDaCenter/rgeoda#38 GeoDaCenter/rgeoda#33
@@ -241,7 +241,7 @@ namespace ttmath | |||
/*! | |||
on 64bit platforms one word (uint, sint) will be equal 64bits | |||
*/ | |||
typedef unsigned long uint; | |||
typedef unsigned long long uint; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lixun910 I should pay attention to this change:
unsigned long long is guaranteed to be at least 64 bits, regardless of the platform. unsigned long is guaranteed to be at least 32 bits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway, this could be discarded by switching to boost::centroid
No description provided.