-
Notifications
You must be signed in to change notification settings - Fork 141
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
RealFloat Zero Padded Exponent #643
Comments
Perhaps the way to support this is a higher-order interface that takes Another idea is to provide a function of type |
This is much more flexible. Thank you for the idea. |
@clyring I have been unable to make your suggestion performant. I have tried several ways but am consistently getting results that are 150-300% slower. Could you make some recommendations on how modify the overhaul-realfloat branch to implement your suggested change? |
This seems to be going beyond the intended capabilities of the intended formatting capabilities. |
I'd expect there is a practical way to get an appropriately general interface for this without requiring such a performance hit. Perhaps using But it would be nice to provide an interface flexible enough to support this. Let's leave the issue open for now. |
I have been thinking about this and perhaps the most flexible option for printing both the mantissa and exponent would be to extract F2S, D2S, and their dependencies that calculate the digits word and exponent integer to a new package. This would allow the most flexibility for custom printing of the mantissa and exponent and would allow other text types to use it for their own printing implementations. |
Also, a problem with your proposed approach. |
Some dxf files have doubles encoded in scientific notation with the exponent padded with zeros.
https://github.com/LibreCAD/LibreCAD/blob/8e10245994d8307a76cedc3cbffe471de88c8325/librecad/support/library/algoritm/alg27.dxf#L1560
I suggest adding a Bool to FGeneric and FScientific to allow for padding the exponent with zeros to the maximum precision of the exponent.
The text was updated successfully, but these errors were encountered: