math icon indicating copy to clipboard operation
math copied to clipboard

`flsgn` inconsistency for `-0.0` and `+nan.0`

Open LiberalArtist opened this issue 1 year ago • 0 comments

The docs claim that flsgn is “like sgn … but restricted to flonum input.” However, the two functions behave differently for -0.0 and +nan.0:

#lang racket
(require math/flonum)

(flsgn -0.0);-> 0.0
(sgn -0.0)  ;-> -0.0

(flsgn +nan.0);-> 0.0
(sgn +nan.0)  ;-> +nan.0

LiberalArtist avatar Oct 20 '24 19:10 LiberalArtist