<div id="spacer"></div>
<div id="footer">
<span id="core_info">Powered by: <a class="footer_link" href="http://libre.adacore.com/tools/aws/">AWS</a> | <a class="footer_link" href="http://gitweb.devoid-pointer.net/?p=Nine-Q.git;a=summary">Nine-Q</a> | <a class="footer_link" href="http://archlinux.org">Arch Linux</a></span>
- <span id="nineq_version_tag">Ver.: 0.03A</span>
+ <span id="nineq_version_tag">Ver.: 0.03B</span>
</div>
</div>
</body>
ExpDecimals: constant FH_Float := 10.0 ** Decimals;
MNum: FH_Float := Num;
begin
- Integer_Part_F := FH_Float'Floor(MNum);
+ declare
+ EPSILON: constant FH_Float := 10.0 ** (-(Decimals + 1));
+ FPE: constant FH_Float := FH_Float'Floor(MNum + EPSILON);
+ F: constant FH_Float := FH_Float'Floor(MNum);
+ begin
+ if FPE > F then
+ Integer_Part_F := FPE;
+ MNum := MNum + EPSILON;
+ else
+ Integer_Part_F := F;
+ end if;
+ end;
Decimal_Part_F := (MNum - Integer_Part_F) * ExpDecimals;
Decimal_Part_I := Integer(Decimal_Part_F);
package FHEF is new Ada.Numerics.Generic_Elementary_Functions(FH_Float);
use FHEF;
- EPSILON: constant FH_Float := 10.0 ** (-(FH_Float'Digits - 1));
+ EPSILON: constant FH_Float := 10.0 ** (-(Decimals + 1));
+ VDIV: constant FH_Float := 10.0 ** Decimals;
Log_Num: FH_Float;
Diff: Integer;
Zero_String: UB_Text;
else
Log_Num := FH_Float'Ceiling(Log(Base => 10.0, X => Num));
--Ada.Text_IO.Put_Line("Log_Num: " & FH_Float'Image(Log_Num));
- --Ada.Text_IO.Put_Line("NRem: " & FH_Float'Image(FH_Float'Remainder(Num, 10.0)));
- if Abs(FH_Float'Remainder(Num, 100.0)) <= EPSILON then
+ --Ada.Text_IO.Put_Line("Num: " & FH_Float'Image(Num));
+ if Abs(FH_Float'Remainder(Num, VDIV / 10.0)) <= EPSILON then
+ --Ada.Text_IO.Put_Line("Fixing up zeros - divisible by 100");
Log_Num := Log_Num + 1.0;
end if;
end if;