# Thread: [2.50.2] Negative Max Float Error?

1. I get a truncation warning on -100000, but not -99999. Perhaps it truncates the integer part to six digits and is including the minus in that.
It used to be that constants couldn't be negative. It could be related to that; that truncation would have been safe originally.

2. Originally Posted by Saffith
I get a truncation warning on -100000, but not -99999. Perhaps it truncates the integer part to six digits and is including the minus in that.
It used to be that constants couldn't be negative. It could be related to that; that truncation would have been safe originally.
Add a decimal portion to it. It will error on:

const float NN = -999998.9999;

Any negative integer smaller than 999999. and any negative float smaller than -21473.0001 is truncated.

3. Do you mean -99998.9999? -999999.9999 is much too low. I don't see any errors on -99999.9999 or -99998.9999.
I noticed this, however:
const float ASDF=-100.9999;

Trace(ASDF);
Trace(-100.9999);

That prints
-99.0001
-100.9999

That seems to support the hypothesis that it's simply dropping a digit. It only checks six characters before the decimal point, then adds everything after that.
In any case, I can probably figure out how to fix it.

Edit: Yep. Fixed.

4. Originally Posted by Saffith
Do you mean -99998.9999? -999999.9999 is much too low. I don't see any errors on -99999.9999 or -99998.9999.
I noticed this, however:
const float ASDF=-100.9999;

Trace(ASDF);
Trace(-100.9999);

That prints
-99.0001
-100.9999

That seems to support the hypothesis that it's simply dropping a digit. It only checks six characters before the decimal point, then adds everything after that.
In any case, I can probably figure out how to fix it.

Edit: Yep. Fixed.

Oh, yes, I did mean that. Typed an extra 9 there; didn't I?

The sign as a string char...that figures. Good to know that it's fixed for the future.

Does it now support MIN_FLOAT of -214747.9999 ? or some other value?

5. Yes, it's -214747.9999.

6. Originally Posted by Saffith
Yes, it's -214747.9999.
Good, very very good. Thank you.

As a side- note, this just created an blindingly easy 2.50.3 versus 'earlier versions' validation. At least I will be sure of completing all the std update and zscript docs files before that is ready. :p

Seriously though, I truly am almost done with everything except the std.txt docs. Those are on my list. I'm rewording some thing sin zscript.txt now, and adding some sections. I added a heading on system timing, that you might want to verify, and I'll send you that as a PM.