Informix Error -1223: Value will not fit in a FLOAT.
Cause and resolution
Value will not fit in a FLOAT.
The FLOAT data type can accept numbers within a certain range of exponents. The maximum and minimum exponent values are different depending on the host operating system (the range is the same as that supported by the C compiler for double values in this host system). In the current statement, a constant number is being converted for storage in a FLOAT variable or column, and the exponent is too large or too small.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1223 is the FLOAT counterpart to -1222's SMALLFLOAT case: it fires when a numeric
constant's exponent exceeds what the platform's C compiler supports for double values — per
the official guidance, FLOAT maps to C double, so the limit is platform-specific.
- A value with an exponent larger than the platform's
double(C compiler) range, per the official guidance — the direct, only cause, at a far larger scale than -1222'sSMALLFLOAT(Cfloat) limit.
Solutions / Resolution
- Reconsider whether the value's actual magnitude is correct, since exceeding
double's exponent range is an extreme case — double-check the computation or literal that produced it. - Use
DECIMALfor very large or very small magnitudes, if genuinely needed, sinceDECIMAL's own range (1.000E-130to1.000E+126, per -1200/-1201) may or may not accommodate the value either — check against those bounds too.
Examples
An exponent beyond the platform's double range
DEFINE v_val FLOAT;
LET v_val = 1.0e400;
-- -1223: exceeds this platform's double (C compiler) exponent range
Diagnostic Checks
- Check the value's exponent against the platform's
double(C compiler) range, and double-check the computation or literal that produced such an extreme value.
Related Errors / Related Topics
- -1222 — "Value will not fit in a SMALLFLOAT." The
SMALLFLOAT(Cfloat) counterpart to this same kind of platform-specific exponent-range restriction.
The value's exponent exceeds the platform's double (C compiler) range for FLOAT — verify the
value's actual intended magnitude.