Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of significant digits (precision) returned by SCPI_ResultDouble #101

Open
jfichtner opened this issue Jul 10, 2018 · 1 comment
Open

Comments

@jfichtner
Copy link
Contributor

Hello @j123b567, have you ever considered making the number of significant digits returned by SCPI_ResultDouble configurable? Or perhaps creating another function (e.g. "SCPI_ResultDoubleN(scpi_t * context, double val, size_t prec)") that provides a parameter for precision?

I am using scpi-parser in an instrument that uses doubles to represent a value with 8 significant digits, and some of the stakeholders on my team mentioned that the 15 digits that are returned are less than ideal, given the extra 7 meaningless digits in a result that is returned at a rate of 100 rdgs/sec. I figured maybe you had thought about this before, and if not, I wondered if you'd be open to that sort of feature.

@j123b567
Copy link
Owner

You have several possibilities

  • Use ResultFloat instead of ResultDouble
  • Change number of digits in config.h
  • Implement your own custom return function, just take inspiration from other result functions.

It is not so easy to make it configurable because it uses several techniques on different platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants