aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-fcvt.ads
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-04-16 11:31:41 +0200
committerTristan Gingold <tgingold@free.fr>2017-04-19 20:48:23 +0200
commit918d0411347bdb2d8e5027a58803a072613e02b2 (patch)
treec078d225731eb96d0c9f5ecb634ea75370208b11 /src/grt/grt-fcvt.ads
parent7d17b527ea6bad8ef1e3f5450c0d7899c60febee (diff)
downloadghdl-918d0411347bdb2d8e5027a58803a072613e02b2.tar.gz
ghdl-918d0411347bdb2d8e5027a58803a072613e02b2.tar.bz2
ghdl-918d0411347bdb2d8e5027a58803a072613e02b2.zip
Use grt.fcvt for 'image.
Diffstat (limited to 'src/grt/grt-fcvt.ads')
-rw-r--r--src/grt/grt-fcvt.ads26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/grt/grt-fcvt.ads b/src/grt/grt-fcvt.ads
index e1e272850..2ec42fcfa 100644
--- a/src/grt/grt-fcvt.ads
+++ b/src/grt/grt-fcvt.ads
@@ -30,6 +30,32 @@
with Interfaces; use Interfaces;
package Grt.Fcvt is
+ pragma Preelaborate;
+
+ -- Convert (without formatting) number V.
+ -- The result is LEN characters stored to STR. If STR is too short, then
+ -- the output is truncated but LEN contains the number of characters that
+ -- would be needed. The procedure assumes STR'First = 1.
+ -- The digits are the digits after the point. The output has to be read as
+ -- 0.NNNNN * 10**EXP
+ -- IS_NUM is true if V is a number and false for NaN or Infinite.
+ -- IS_NEG is true if the number if negative.
+ procedure To_String (Str : out String;
+ Len : out Natural;
+ Is_Num : out Boolean;
+ Is_Neg : out Boolean;
+ Exp : out Integer;
+ V : IEEE_Float_64);
+
+ -- Formatting.
+
+ -- For 'Image
+ -- STR must have at least 24 characters:
+ -- Sign (1) + digit (1) + dot (1) + digits (15) + 'e' (1) + sign (1)
+ -- + exp_digits (4) -> 24.
+ procedure Format_Image
+ (Str : out String; Last : out Natural; N : IEEE_Float_64);
+
-- Convert V to 10-based number stored (in ASCII) in STR/LEN [using at most
-- NDIGITS digits.]
-- LEN is the number of characters needed (so it may be greater than