From 464259ae4be27dcf43f3273e2217cb226bebdc71 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 18 Apr 2017 05:05:20 +0200 Subject: Rewrite to_string(real, digits) using grt.fcvt --- src/grt/grt-fcvt.ads | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/grt/grt-fcvt.ads') 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 -. -- cgit v1.2.3