You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/28 20:51:52 UTC

[GitHub] [arrow-nanoarrow] paleolimbot commented on a diff in pull request #77: [C] Fix AppendDouble to accept all values on float arrays

paleolimbot commented on code in PR #77:
URL: https://github.com/apache/arrow-nanoarrow/pull/77#discussion_r1034036107


##########
src/nanoarrow/array_inline.h:
##########
@@ -303,10 +303,10 @@ static inline ArrowErrorCode ArrowArrayAppendDouble(struct ArrowArray* array,
     case NANOARROW_TYPE_DOUBLE:
       NANOARROW_RETURN_NOT_OK(ArrowBufferAppend(data_buffer, &value, sizeof(double)));
       break;
-    case NANOARROW_TYPE_FLOAT:
-      _NANOARROW_CHECK_RANGE(value, FLT_MIN, FLT_MAX);
-      NANOARROW_RETURN_NOT_OK(ArrowBufferAppendFloat(data_buffer, value));
+    case NANOARROW_TYPE_FLOAT: {
+      NANOARROW_RETURN_NOT_OK(ArrowBufferAppendFloat(data_buffer, (float)value));
       break;
+    }

Review Comment:
   ```suggestion
       case NANOARROW_TYPE_FLOAT:
         NANOARROW_RETURN_NOT_OK(ArrowBufferAppendFloat(data_buffer, (float)value));
         break;
   ```
   
   (Feel free to revert, just a bit out of place with the other cases here)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org