Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

print floats in ada

I want to print a float number, i am using the package FLOAT_IO.

Is there a way to control the number of digits after the dot and before it?

like image 428
Doron Sinai Avatar asked Dec 27 '10 10:12

Doron Sinai


1 Answers

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.

like image 110
Ondrej Tucny Avatar answered Nov 09 '22 01:11

Ondrej Tucny