We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0844f19 commit 2a2b0b6Copy full SHA for 2a2b0b6
src/value.cpp
@@ -863,6 +863,7 @@ int64_t DateValue::toInt64(size_t /*n*/) const {
863
uint32_t DateValue::toUint32(size_t /*n*/) const {
864
const int64_t t = toInt64();
865
if (t < 0 || t > std::numeric_limits<uint32_t>::max()) {
866
+ ok_ = false;
867
return 0;
868
}
869
return static_cast<uint32_t>(t);
@@ -875,6 +876,7 @@ float DateValue::toFloat(size_t n) const {
875
876
Rational DateValue::toRational(size_t n) const {
877
const int64_t t = toInt64(n);
878
if (t < std::numeric_limits<int32_t>::min() || t > std::numeric_limits<int32_t>::max()) {
879
880
return {0, 1};
881
882
return {static_cast<int32_t>(t), 1};
0 commit comments