Logarythms in numerical Stack Questions

Logarythms in numerical Stack Questions

by Elisabeth John -
Number of replies: 2

Hi there,

I am creating several numerical questions, usually with multiple answers of different type.

I just started with a set of pH calculations that include the calculation of a logarythm (decadical, lg) for the teachers answer. But no matter what i do, whenever i check the correct answer in the preview i get "-lg(x)" (where x was calculated correctly and represents some value), but I want a Number!

I tried float which results in the whole formula being shown, and i tried radcan to simplify.

If i calculate the logarythm and insert it as answere it is not recognized as correct (even lg(100)=10, so its no preciseness issue)

Can someone please give me a hint what to try next?

Elisabeth


Average of ratings: -
In reply to Elisabeth John

Re: Logarythms in numerical Stack Questions

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Argh yes, docs on this issue are here: https://docs.stack-assessment.org/en/CAS/Simplification/#logarithms-to-an-arbitrary-base

Try
n1:lg(100);
n2:ev(n1, lg=logbasesimp);
Not at all obvious that this simplification is not included by default!
In reply to Christopher Sangwin

Re: Logarythms in numerical Stack Questions

by Elisabeth John -

Perfect! But I had to include float() as well otherwise I got a fraction of logarythms.

Thanks a lot.