Controlling Digits output for same numbers used but different outputs

asked 2018-07-26 11:17:53 -0500

I am a teacher how is working with sagetex to automate some worksheets to save some time on creating different versions.

Worksheet Example

In my worksheets students are given numbers to 2 or 3 digits of accuracy, but later there is a solution guide attached, and I would like to change the level of accuracy. An example: 2.5 times 350 equals 875, but rounded to 2 digits is 880. I would like to change the accuracy of the solutions produced.

I am still very new to all this, and would love any advice or help.

CoCalc Kinetic Energy tex file

CoCalc Kinetic Energy Worksheet pdf



edit retag flag offensive close merge delete


Your links don't work. You should write any relevant code here instead. Do I understand correctly that for x = 875 and digits_accuracy = 2 you want to obtain round(x/10^(len(str(x))-digits_accuracy))*10^(len(str(x))-digits_accuracy)?

rburing gravatar imagerburing ( 2018-07-26 12:21:23 -0500 )edit