I’m developing a program that makes some floating points calculations.
Is there any way to test my functions (which deliver floats) with doctests?
I’m developing a program that makes some floating points calculations. Is there any way
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sure, just format the floats with a reasonable format, based on your knowledge of what precision you expect them to exhibit — e.g, if you expect accuracy to 2 digits after the decimal point, you could use: