maths / moodle-qtype_stack

Stack question type for Moodle
GNU General Public License v3.0
138 stars 147 forks source link

ATNumSigFigs bug? #1108

Closed alcarola closed 2 months ago

alcarola commented 5 months ago

Hi, here I report yet another ATNumSigFigs mystery. Is this the expected behaviour?

(%i1) ATNumSigFigs(9.8,10,2,"9.8");
(%o1) [true,true,"",""]

I would think that 9.8 is not equal to 10 up to two significant digits? This is the behaviour I would expect, also for 9.8:

(%i2) ATNumSigFigs(9.5,10,2,"9.5");
(%o2) [true,false,"ATNumSigFigs_Inaccurate. ","stack_trans('ATNumSigFigs_Inaccurate'); !NEWLINE!"]

I tried this in my STACK-Maxima sandbox.

$plugin->version = 2023060500; $plugin->release = '4.4.4 for Moodle 3.9+'; Maxima 5.41.0 http://maxima.sourceforge.net using Lisp SBCL 1.4.6-1.fc29

sangwinc commented 2 months ago

Yes, this isn't actually a bug. I'm sorry if the design is not clear but it's doing what I intended it to do. That might not be what you need, or might not be that useful in general. Sorry....