You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have been modified yicies_solver for my term project.
I found that kMinValue[0](Minimum value of U_CHAR) does not give me correct value(0)
for(size_t i = 0 ; i < 1 ; ++i)
{
fprintf(stdout, "\tkMinValue[%u, %s]: %lld\n", i, type_names[i], kMinValue[i]);
fprintf(stdout, "\tkMaxValue[%u, %s]: %lld\n", i, type_names[i], kMaxValue[i]);
}
from above codes,
I saw the result live below
I know that kMaxValue is initialized at basic_types.cc as numeric_limits::min()
but I wonder why I got the wrong result.
If you are printing the value make sure you use it converted to an integer. This is because by default, the C++ i/o streams convert 8 bit integer values to their ASCII counterpart which can cause some problems, that can be seen with this:
#include <iostream>
#include <limits>
#include <cassert>
using namespace std;
using std::numeric_limits;
int main(){
cout << numeric_limits<unsigned char>::min() << endl;
cout << (int)numeric_limits<unsigned char>::min() << endl;
return 0;
}
In this case the first print returns \00 and the second print returns the correct value: 0.
Hello, I have been modified yicies_solver for my term project.
I found that kMinValue[0](Minimum value of U_CHAR) does not give me correct value(0)
from above codes,
I saw the result live below
I know that kMaxValue is initialized at basic_types.cc as numeric_limits::min()
but I wonder why I got the wrong result.
Thanks.
The text was updated successfully, but these errors were encountered: