[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.
Serge Stroobandt added the comment: Dear Keith, that is exactly how it should be! (I cross-checked with a HP calculator to make sure.) -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26223> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.
Serge Stroobandt added the comment: What most engineers would like to see implemented in Python is a new engineering notation identical to the one implemented in the omnipresent HP calculators. Quoting from the HP-15C Owner's Handbook: "- In engineering notation, the first significant digit is always present in the display. The number you key in after f ENG specifies the number of additional digits to which you want to round the display. - Engineering notation shows all exponents in multiples of three." Source + examples, see page 59: http://www.hp.com/ctg/Manual/c03030589.pdf Most of the time, engineers are not after high precision. Ball park figures are good enough in a world where everything is built to a specified tolerance. For example, most electronic resistors feature 5% tolerance. Safety factors take care of the rest and assure a building will not collapse. This should not be that difficult to implement? I promise, every six months an engineer will stop by here asking for this. Instead of nagging, this could already have been implemented one way or the other. The large demand for this feature really warrants it. Thanks! -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26223> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8060] PEP 3101 string formatting missing engineering presentation type for floating point
Serge Stroobandt added the comment: As per https://bugs.python.org/issue26223#msg259772 , can we please reopen this? I kind of hate it when *real* issues are kept closed for years (6!) until another lost soul comes by with the same itch... -- nosy: +serge.stroobandt versions: +Python 3.6 -Python 3.2 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8060> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.
Serge Stroobandt added the comment: Related issue: https://bugs.python.org/issue8060 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26223> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.
Serge Stroobandt added the comment: Mark: Don't shoot the messenger! I literally quoted the implemented proprietary specification. However, I do agree that the term "numbers (or bases) with an infinte decimal representation" would be more appropriate in this context. Also, improving documentation is good, but having a new function with the desired *true* engineering notation would be even better! Admittedly, this was my ultimate objective for filing this enhancement bug. Thanks for commenting on StackExchange. -- type: behavior -> enhancement ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26223> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.
Serge Stroobandt added the comment: An emphasized version of the exact quote is here now: http://stackoverflow.com/a/35045233/2192488 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26223> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.
New submission from Serge Stroobandt: In https://docs.python.org/2/library/string.html#formatstrings the proprietary (IBM) specifcation "Decimal Arithmetic Specification" http://www.gobosoft.com/eiffel/gobo/math/decimal/daconvs.html is incorrectly being heralded as "the" specifiaction for engineering notation. However, upon reading this IBM specifation carefully, one will note that the specifaction itself actually admits not applying the engineering notation in the case of infinite numbers. An emphasized version of the exact quote accompanied with a discussion can be found here: http://stackoverflow.com/a/17974598/2192488 Correct behaviour for decimal.to_eng_string() would be to equally employ engineering notation in the case of infinite numbers. I suggest renaming the current behaviour to decimal.to_ibm_string(). References: http://www.augustatech.edu/math/molik/notation.pdf https://en.wikipedia.org/wiki/Engineering_notation https://en.wikipedia.org/wiki/General_Conference_on_Weights_and_Measures http://www.bipm.org/en/CGPM/db/11/11/ PS: I am a MSc in Electronic Engineering. -- components: Extension Modules files: engineering_notation.pdf messages: 259047 nosy: Keith.Brafford, eric.smith, ezio.melotti, serge.stroobandt priority: normal severity: normal status: open title: decimal.to_eng_string() does not implement engineering notation in all cases. type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file41730/engineering_notation.pdf ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26223> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.
Serge Stroobandt added the comment: @rhettinger I completely agree with not creating a backward incompatibility at this point in time. The real issue is that decimal.to_eng_string() was written to a (unfortunately chosen) proprietary specification which does not entirely correspond to the engineering notation. A quick web search shows that a lot of people are in search of a *true* engineering notation implementation. In the phylosophy of "batteries included" it is a pity this useful and very common notation is currently missing in Python. I would therefore suggest adding a decimal.to_true_eng_string() with the true engineering notation. Hence, this bug could be reclassified as asuggestion for enhancement. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26223> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com