IEEE Standard Warning

Hello! Does anybody know how to resolve the "exceeds IEEE standard" warning here? TimeNum_num comes from a text file that has TimeNum data written as "111,000.000".

TimeNum_num = StrToNum("111,000.000");
test = StrRight(NumToStr(TimeNum_num),7)=="000.000";

I need to check if the number ends with "000000"

It is just a warning. Is it maybe possible to deactivate it?

SetOption( "WarningLevel", 3 );

https://www.amibroker.com/guide/afl/setoption.html

BUT read here also.

And here:

AFL: WriteVal/NumToStr will display Warning 506 if specified format exceeds maximum IEEE precision (7 significant digits) and roundAndPad option is turned off

AFL: NumToStr protected against user error of specifying precision higher than provided by IEEE standard (display never exceeds 7 significant digits, rest is padded with zeros)

5 Likes

@trongart,
BTW, (and since you haven't realized it yourself yet after few hours)....
If you just need to check a substring of a variable that is string already why do convert to number and then back to string?

Just extract it...

substring = StrExtract( "111,000.000", 1, ',');
test = substring == "000.000";

And forget about deactivating Warnings via SetOption.
Warnings are good not bad.
They mean to say: "Just take a second before deactivating me and think again!"

2 Likes

And just for the sake of multiple roads leading to Rome (and more simplicity):

filecolumn = "111,000.000";
test = StrFind( filecolumn, ",000.000" ) > 0;
2 Likes

All warnings are for a reason:

3 Likes