-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Posit representation precision problem #281
Comments
@Yunfei-Ma-McMaster thanks for pointing this out. As you can see from the command line options, the command As you can see in the output, the posit<64,#> values have 0's in their LSBs, which your decimal value of 0.1 should fill. What you observe there is that the command line interprets the value as a native double and that gets converted to a posit. As a double has fewer precision bits as the posit<64,#>, there is no information to fill the more precise posit bits. On the roadmap are native decimal string converters for all number systems. You will have full control over decimal output in the C++ classes, if you are studying the LSBs. There are also ULP methods to lift the ulp values. Would you be interested to implement the decimal string converter for posits? |
For representation with posit in the command line, the decimal output does not have enough bits, which will confuse rounding results with accurate results.
For example:
The output:
However, no posit can exactly represent 0.1. For instance, posit<32,2> (0.1) = 0.10000000009313226... not 0.1. The command line output seems to not have enough bits to cover the dynamic range of inaccurate representation.
The text was updated successfully, but these errors were encountered: