Skip to content

Commit

Permalink
comment what's going on in AppendFloat
Browse files Browse the repository at this point in the history
  • Loading branch information
mumbleskates committed Mar 19, 2024
1 parent f62508f commit e8dad12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions emit.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ func (e *emitter) emitUint(v uint64, _ int) (err error) {
}

func (e *emitter) emitFloat(v float64, bitSize int) (err error) {
// AppendFloat writes NaN the way we want, but spells infinity values as
// `+Inf` and `-Inf`, which we don't like as much.
if math.IsInf(v, +1) {
_, err = e.w.Write([]byte("Infinity"))
} else if math.IsInf(v, -1) {
Expand Down

0 comments on commit e8dad12

Please sign in to comment.