On Wed, Mar 16, 2011 at 6:15 PM, Jason Grout
<jason-s...@creativetrax.com> wrote:
> On 3/16/11 3:04 PM, Peter Jeremy wrote:
>
>> Overall, I believe the abs(actual-expected)<tiny_number approach is
>> the only practical way to handle doctests.  The expected numeric
>> result is still available, just not on a line by itself.
>
> Crazy idea: What if we introduce a "# numeric 1e-10" doctest flag (like
> #optional, etc.) that does just that---reads in the doctest answer, gets the
> output of the function, and does an abs(actual-expected)< epsilon (where
> epsilon can be specified in the flag, or it has a default).
>
> sage: some_numerical_function() # numeric 1e-6
> 3.43234454
>
> passes if abs(real result-3.43234454)<1e-6

+1, that's a great idea. I'd be up for # [relative|absolute] tolerance
[<epsilon>]

- Robert

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to