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 15:33:19 UTC

[GitHub] [arrow-nanoarrow] lidavidm opened a new issue, #75: [C] AppendDouble doesn't work with most floats

lidavidm opened a new issue, #75:
URL: https://github.com/apache/arrow-nanoarrow/issues/75

   AppendDouble checks that the value is in the range `[FLT_MIN, FLT_MAX]` before appending. However, that's not actually the right check: `FLT_MIN` isn't the "minimum float value" (that doesn't make sense; floats contain infinity), but rather the smallest positive float. Hence, 0 and any negative float will get wrongly rejected.
   
   IMO, it might make sense to just accept any double and cast it to float without thinking. Otherwise, maybe the right check is `(double)((float) v) == v` or something ("is this double exactly representable as a float", perhaps there's an idiom for this though I can't get the right search query to figure this out), though this will not work for NaN.


-- 
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.apache.org

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


[GitHub] [arrow-nanoarrow] paleolimbot commented on issue #75: [C] AppendDouble doesn't work with most floats

Posted by GitBox <gi...@apache.org>.
paleolimbot commented on issue #75:
URL: https://github.com/apache/arrow-nanoarrow/issues/75#issuecomment-1329358735

   I'm OK with a blind cast here...I think that happens for double -> integer as well (we don't currently check that the double is exactly representable as an integer).


-- 
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


[GitHub] [arrow-nanoarrow] lidavidm closed issue #75: [C] AppendDouble doesn't work with most floats

Posted by GitBox <gi...@apache.org>.
lidavidm closed issue #75: [C] AppendDouble doesn't work with most floats
URL: https://github.com/apache/arrow-nanoarrow/issues/75


-- 
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