Bug with polynomial extension

1 view
Skip to first unread message

William Haynes

unread,
May 17, 2022, 7:57:32 PM5/17/22
to Numbas Users
Hi Christian,

If I define H=2, these four all give different results:

P_1 = polynomial(x,[1,1,1])
P_2 = polynomial(x,[1,2/H,4/H^2])
P_3 = polynomial(x,[1,2/H,2/H])
P_4 = polynomial(x,[2/H,2/H,2/H])

Example:  
or 

Will

Christian Lawson-Perfect

unread,
May 19, 2022, 3:29:04 AM5/19/22
to numbas...@googlegroups.com
Ah, it didn't account for the `rational` data type. I've added a line to make sure it converts all the coefficients to the `number` type.
Thanks for reporting this!

--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/numbas-users/d01b7d72-046e-467d-9d92-ae0f9588a089n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages