Menu

#24 Margin specification in `aim/Test`

open
nobody
Marking (10)
5
2003-10-01
2003-10-01
No

Consider the following question:

t> Please enter $\pi$ to 20 decimal digits.
s> [ ans -> `aim/Test`(ans,eval (Pi,20),
numeric,`sf`=20),
evalf(Pi,20)]

This produces the teacher's answer
3.1415926535897932385 but marks an answer of
3.1415926535 as correct as well.

Discussion

  • Greg Gamble

    Greg Gamble - 2003-10-01

    Logged In: YES
    user_id=766524

    This is because Digits is by default 10.

    > Digits := 20:
    > `aim/TestNumeric`(eval (Pi,20), 3.1415926535, 'sf'=10);
    false

     
  • Neil Strickland

    Neil Strickland - 2003-10-01

    Logged In: YES
    user_id=430681

    I think that `aim/TestNumeric` should set Digits for itself so
    as to produce the expected behaviour. It will probably need
    to declare its arguments as 'uneval' and only evaluate them
    after setting Digits. But there might be some pitfalls with
    this that I haven't thought of.

     

Log in to post a comment.