verma-kartik commented on issue #40563:
URL: https://github.com/apache/arrow/issues/40563#issuecomment-2043233944
@zeroshade @xxgreg `math.inf()` is of type `float64`. I have two
approaches on how to handle these for `float32`:
Either, typecast the value to float64 before checking for `math.IsInf()`,
```go
...
case math.IsInf(float64(f), 1):
vals[i] = "+Inf"
...
```
Or, use the `math.Float32frombits()` to interpret the uint32 value of
IEEE-752 of +Inf as float32,
```go
...
case math.Float32frombits(0x7F800000) == f:
vals[i] = "+Inf"
...
```
Similarly for handling NaN and -Inf.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]