cancel
Showing results for 
Search instead for 
Did you mean: 

Extract the sign bit from a zero float?

DonovanHide
New Contributor
Is it possible in q to extract the sign bit from a zero float? signum returns 0 for both 0 and -0.

Thanks!
2 REPLIES 2

joshmyzie2
New Contributor
Yes, see the signed zero wiki page [1] for more info on its properties.q)signum%[1;0f]1iq)signum%[1;-0f]-1i[1] https://en.wikipedia.org/wiki/Signed_zeroJoshOn 25 July 2015 15:55 UTC, Donovan Hide wrote:> Is it possible in q to extract the sign bit from a zero float? signum > returns 0 for both 0 and -0.>> Thanks!

Brilliant, thanks Josh!