On 2024-08-08 07:16:03 -0500, G. Branden Robinson wrote: > At 2024-08-08T10:07:35+0200, Alejandro Colomar wrote: > > Hmmm, I see. Thanks! I think "If x is ±0" is the clearest way to say > > it. I'm not sure if that glyph is available everywhere, though. How > > about "If x is 0 or -0"? > > I think it's reasonable to assume that it's available.[1] groff's > terminal output devices will either output it as-is or substitute a > fallback. > > $ printf '±\n' | groff -K utf8 -T ascii | cat -s > +- > > An argument could be made that this fallback should render "+/-" > instead. > > With low-capability devices, there's often no single best answer to how > one should limp along. FYI, +-0 could be interpreted by the reader as in C, where a unary minus operator is applied, then a unary plus operator. And about +/-0, the "/" is already used a the division operator, so that this doesn't help parsing. So ideally, the fallback for "±0" should be "+0 or -0", which is much more readable and less ambiguous than "+-0" or "+/-0". But this would imply the following: > In groff, of course, you can ask an output device whether it supports a > given glyph and define a string appropriately--but the first part of > that is not portable to formatters that don't implement groff > extensions, and doing so could rouse the ire of Ingo Schwarze's > mandoc(1). Anyway, currently, for consistency, this should be "+0 or -0", as this is already used: cventin:~/software/man-pages> grep -r '\+0 or' man man/man3/tgamma.3:Pole error: \fIx\fP is +0 or \-0 man/man3/tgamma.3:an argument of +0 or \-0 incorrectly produced a domain error man/man3/pow.3:is +0 or \-0, man/man3/pow.3:is +0 or \-0, man/man3/atan2.3:is +0 or \-0, \-pi/2 is returned. man/man3/atan2.3:is +0 or \-0, pi/2 is returned. man/man3/cosh.3:is +0 or \-0, 1 is returned. man/man3/erfc.3:is +0 or \-0, 1 is returned. -- Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)