I meant the type should be <br><br>val roundFromString : IEEEReal.rounding_mode * string -&gt; real option<br><br><div><span class="gmail_quote">On 7/27/07, <b class="gmail_sendername">Matthew Fluet</b> &lt;<a href="mailto:fluet@tti-c.org">
fluet@tti-c.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>On Fri, 27 Jul 2007, Sean McLaughlin wrote:<br>&gt; As for interval arithmetic, a main concern of mine is that
<br>&gt; the sqrt function rounds correctly given the rounding mode, as specified<br>&gt; in IEEE754.<br><br>The other aspect that I was wondering about was floating-point constants.<br>That is, what should the following program do:
<br><br>val mtenth_lo = (down(); 0.1)<br>val mtenth_hi = (up(); 0.1)<br>val mtenth_near = (near(); 0.1)<br>val mtenth_zero = (zero(); 0.1)<br><br>val _ = print(word8vectorToString (P.toBytes mtenth_lo) ^ &quot;\n&quot;)<br>
val _ = print(word8vectorToString (P.toBytes mtenth_hi) ^ &quot;\n&quot;)<br>val _ = print(word8vectorToString (P.toBytes mtenth_near) ^ &quot;\n&quot;)<br>val _ = print(word8vectorToString (P.toBytes mtenth_zero) ^ &quot;\n&quot;)
<br><br><br>A very strict reading of The Definition says that special constants are<br>evaluated as part of the dynamic semantics, yielding &quot;a value according to<br>normal mathematical conventions&quot;.&nbsp;&nbsp;However, the function from special
<br>constants to values is:<br>&nbsp;&nbsp; val : SCon -&gt; Val<br>and the evaluation rule is:<br>&nbsp;&nbsp; E |- scon =&gt; val(scon)&nbsp;&nbsp; (90)<br>which suggests that the meaning of the special constants are not dependent<br>upon the dynamic state.&nbsp;&nbsp;On the other hand, the function from primitive
<br>functions and arguments to values is:<br>&nbsp;&nbsp; APPLY : BasVal * Val -&gt; Val + Pack<br>and the evaluation rule is:<br>&nbsp;&nbsp; E |- exp =&gt; b&nbsp;&nbsp;E |- atexp =&gt; v&nbsp;&nbsp;APPLY(b,v) = v&#39;/p<br>&nbsp;&nbsp;---------------------------------------------------
<br>&nbsp;&nbsp; E |- exp atexp =&gt; v&#39;/p<br>which also suggests that primitives are pure functions, not dependent upon<br>the dynamic state.&nbsp;&nbsp;Since Real&lt;N&gt; arithmetic already steps outside of<br>this, the question arises as to whether the evaluation of real constants
<br>should also step outside this.<br><br><br></blockquote></div><br>