print floats in ada
I want to print a float number, i am using the package FLOAT_IO
.
Is th开发者_如何学JAVAere a way to control the number of digits after the dot and before it?
The procedure Put
in Ada.Float_Text_IO
has three optional format-controlling parameters Fore
, Aft
, Exp
that control the output. The meaning of these parameters is as follows:
Fore
denotes the number of digits (including the possible negative sign and leading zeros) before the dot;Aft
denotes the number of digits after the dot (including any trailing zeros);Exp
denotes the number of digits of the exponent (if necessary).
For a more thorough description and the default values of the format-controlling parameters see the Ada 95 Reference Manual, section A.10.9.
精彩评论