diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-04-18 05:05:20 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-04-19 20:48:24 +0200 |
commit | 464259ae4be27dcf43f3273e2217cb226bebdc71 (patch) | |
tree | d1d02c5892a516e5144f888b2e9264e34f399da7 /src/grt/grt-fcvt.ads | |
parent | 99c6e3e3b91e60e9f79195e5c36e217ff2196e50 (diff) | |
download | ghdl-464259ae4be27dcf43f3273e2217cb226bebdc71.tar.gz ghdl-464259ae4be27dcf43f3273e2217cb226bebdc71.tar.bz2 ghdl-464259ae4be27dcf43f3273e2217cb226bebdc71.zip |
Rewrite to_string(real, digits) using grt.fcvt
Diffstat (limited to 'src/grt/grt-fcvt.ads')
-rw-r--r-- | src/grt/grt-fcvt.ads | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/grt/grt-fcvt.ads b/src/grt/grt-fcvt.ads index 9fad63c06..6b278fe60 100644 --- a/src/grt/grt-fcvt.ads +++ b/src/grt/grt-fcvt.ads @@ -56,6 +56,21 @@ package Grt.Fcvt is procedure Format_Image (Str : out String; Last : out Natural; N : IEEE_Float_64); + -- For To_String (Value : Real; Digits : Natural) + procedure Format_Digits (Str : out String; + Last : out Natural; + N : IEEE_Float_64; + Ndigits : Natural); + + -- Reduce the precision of STR to PREC digits after the point. If PREC is + -- too large, this is no-op. + -- STR, LEN, EXP are the output of To_String, that is: + -- 0.STR * 10**EXP + procedure Format_Precision (Str : in out String; + Len : in out Natural; + Exp : in out Integer; + Prec : Positive); + -- Input format is [+-]int[.int][e[+-]int] -- where int is digit { _ digit } -- and [+-] means optional + or -. |