<div dir="ltr">Currently  the `~r&#39; format routine, which accepts rationals, barfs on +nan.0 and siblings, which are not rationals.  My current use case is simply displaying sub-ranges of vectors of flonums.  It is not a problem to check for +nan.0 and explicitly display it. I was just wanted to toss it out as a don&#39;t know what is the &quot;right thing&quot; for the `~r&#39; format routine to do here.<div>
<div><br></div><div>&gt; (define: x : Flonum +nan.0)</div><div><div>&gt; (define: y : Flonum 3.145962)</div><div>&gt; (~r y)</div><div>- : String</div><div>&quot;3.145962&quot;</div><div><div>&gt; (~r x)</div><div>~r: contract violation</div>
<div> expected: rational?</div><div> given: +nan.0</div></div></div><div>...</div><div><br></div></div></div>