Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/5] Allow printing floating point in scientific notation


Allow printing floating point values in scientific notation, and
specifying significant figures (which uses MRelative of Dragon4).
Something like

    std.put("{e,s=2}\n", -0.000345)

should print "-3.4e-4".

The "e" format param prints the exponent as "eXXXX", and the "s=N" uses
N >= 1 significant figures.

S. Gilles (5):
  Collect fltXYbfmt parameters into analogue of intparams
  Allow padding for fltXY formatting
  Specify sigfigs (cutoff + Relative mode) for fltXY formatting
  Split out intfmt to a separate file.
  Allow printing fltXY in scientific notation

 lib/std/bld.sub         |   1 +
 lib/std/fltfmt.myr      | 129 +++++++++++++++++++------
 lib/std/fmt.myr         |  95 +++++++-----------
 lib/std/intfmt.myr      |  79 +++++++++++++++
 lib/std/test/fltfmt.myr | 207 ++++++++++++++++++++++++++++++++++++++--
 5 files changed, 413 insertions(+), 98 deletions(-)
 create mode 100644 lib/std/intfmt.myr

-- 
2.23.0


Follow-Ups:
[PATCH 1/5] Collect fltXYbfmt parameters into analogue of intparams"S. Gilles" <sgilles@xxxxxxxxxxxx>
[PATCH 2/5] Allow padding for fltXY formatting"S. Gilles" <sgilles@xxxxxxxxxxxx>
[PATCH 3/5] Specify sigfigs (cutoff + Relative mode) for fltXY formatting"S. Gilles" <sgilles@xxxxxxxxxxxx>
[PATCH 4/5] Split out intfmt to a separate file."S. Gilles" <sgilles@xxxxxxxxxxxx>
[PATCH 5/5] Allow printing fltXY in scientific notation"S. Gilles" <sgilles@xxxxxxxxxxxx>