# 32 — float is a type a float used to be a bit on a local. a call, a global, a field, a parameter and a return forgot it, so the next `+` was an integer add unless the programmer wrote the literal again. `-0.0` was true in `if`, because the test was the integer one and the sign bit is set. `1.field` was a float, because a dot after digits was always a fraction. `float` is type kind 12. a literal, a local declared `float`, a global, a field, an index, a dereference, a parameter and a call result are floats. assigning an int into a float converts with opcode 608, and assigning a float into an int converts with 609. a `word` keeps the bits. `+ - * /` and the six comparisons promote whichever side is not already a float. `++` stays an integer add. the vm's `jz` is still an integer test. where a float is used as a condition (`if`, `while`, `for`, `do`, `?:`, `&&`, `||`, `!`) the compiler emits a compare with `+0` and inverts it, so both zeros are false and every other value, including a NaN, is true. `zc0` emits the same test, so a run-only image does too. the spelling `-0.0` is unary minus of `0.0`, and `0 - 0` is `+0`; a product such as `0.0 * -1.0` is a real negative zero, and that is the value the test covers. `1.field` is an integer and a field. the dot is a fraction only when a digit or an exponent follows it (`1.5`, `1.`, `1.e2`, `1.+2`). a letter is a field name. an integer or a word used as the base resolves a field name that belongs to exactly one struct in that program, and the address is the base plus the field's offset. `tests/ftype.zc` prints `&(1.field)` as 2, because `field` is the second word of `cell`, and it reads and writes that field through a word that holds an object's address. `tests/ftruth.zc` is in the zc0 subset. the line is `00111000110107`. `tests/ftype.zc` needs the resident compiler. the line is `3.500000 10.500000 3.500000 4.250000 5.250000 4.250000 6.500000 2 4 4.250000 8.500000 1 4`. the fixpoint image is 103348 words, 826784 bytes. the stage-0 image is 99284 words. the small compiler's stage-0 image is 99283 words, so its reservation moved from 97280 to 100352 and that machine is now 184320 words. the run-only reservation stays 14336 in the 36864-word machine. `tests/ftruth.zc` there is 13693 words. `test.sh` after this stage is 391 passed, 0 failed. the new checks are the negative-zero line and the float-type line on the interpreter, the microcore, the arm64 jit and the llvm backend; both lines on the small microcore and on `core.c` at that size; the run-only image of the negative-zero program; both virt boards running that program and compiling it and the float-type program; a soft-float interpreter on the negative-zero line; and `ZYHOT=1` on both. what is still open: `o3` does not lift 600..609, and a region that contains a float literal can be misread because the lifter does not skip the payload word. magnitudes past about 1e32 still print as `inf`, and a parsed significand is still at most 15 digits.