Contact

FLT.NEXTAFTER Function (Gnumeric)

Math Beginner Gnumeric Gnumeric 1.12.57

Use Gnumeric FLT.NEXTAFTER to inspect neighboring representable numbers, direction rules, binary64 spacing and source-checked coercion boundaries.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: For a binary64 build, =FLT.NEXTAFTER(1,"+") has reference value 1.0000000000000002. It moves one representable step towards the direction, rather than adding a fixed decimal increment.

Availability and evidence scope

  • Introduced: Gnumeric 1.12.57. Its release notes name all four FLT functions as new testing aids. No exact introduction day is inferred.
  • Source support: Registered in the Floating Point Functions plugin in Gnumeric 1.12.62. No retirement is established. Last functioning application version is unverified for this guide.
  • Build scope: Numeric constants and neighbors depend on the selected floating type. The numeric definitions distinguish double, long-double and experimental decimal64 configurations. Binary64 examples below are explicitly conditional.
  • Evidence dates: Gnumeric release source was retained October 13–14, 2026 and reviewed October 15. Reference calculations and Python library controls ran October 15. They are independent numerical evidence, not native Gnumeric, headless application or GUI execution.

Syntax and direction

=FLT.NEXTAFTER(x,y)

Both arguments are required. x is the starting numeric value. A numeric y selects the direction towards that value; it is not a distance or step count. The exact strings “+” and “-” stand for positive and negative infinity as directions. The callback calls the numeric build’s nextafter routine. If x equals numeric y, the reference result is y, so there is no movement.

For example, from 1 the targets 2 and 100 select the same immediate neighbor. From -1, direction “+” moves upwards towards zero, while “-” moves to a more negative value. Direction 0 means towards zero for either sign. A displayed rounded result may look identical to x even though its stored reference value is the adjacent representable number.

Reproducible spacing worksheet

Create Neighbors with x in A1, Up in B1 and Down in C1. Enter 0.5, 1, 2 and -1 in A2:A5. In B2 put =FLT.NEXTAFTER(A2,"+"), and in C2 put =FLT.NEXTAFTER(A2,"-"); fill both down. In D2 use =B2-A2 and E2 use =A2-C2, then fill down. Display the gaps scientifically.

For binary64, the upward gaps in rows 2–5 are respectively 2^-53, 2^-52, 2^-51 and 2^-53. The downward gaps are 2^-54, 2^-53, 2^-52 and 2^-52. The asymmetric -1 row is intentional: upwards there means towards zero. These reference gaps are independently checked with a bit-pattern model and a local Python numeric library, not Gnumeric execution.

Binary64 reference results

Formula Independent binary64 or source-rule result
=FLT.NEXTAFTER(1,"+") 1.0000000000000002
=FLT.NEXTAFTER(1,0) 0.9999999999999999
=FLT.NEXTAFTER(1,100) 1.0000000000000002
=FLT.NEXTAFTER(1,1) 1
=FLT.NEXTAFTER(-1,"+") -0.9999999999999999
=FLT.NEXTAFTER(-1,"-") -1.0000000000000002
=FLT.NEXTAFTER(0,"+") Exactly 2^-1074 with binary64 gradual underflow
=FLT.NEXTAFTER(1,"0") #VALUE! from the source’s direction-type rule
=FLT.NEXTAFTER(1,"up") #VALUE! from the source’s direction-type rule

The decimal strings are convenient representations of the exact binary numbers; they are not promises about Gnumeric’s default cell display. The direction strings require ordinary straight quotation marks in the formula. A locale can use a different argument separator; no locale-specific entry session was run.

Source-checked coercion and errors

The registered argument types are fS. The shared scalar dispatcher converts an empty first argument to numeric zero and tries locale-sensitive numeric parsing for text in the first argument. It does not perform that numeric-text conversion for the second argument. Thus the quoted direction “0” is rejected while numeric 0 is accepted. Do not extrapolate this into an all-text coercion rule for both positions.

Gnumeric’s VALUE_IS_NUMBER macro includes booleans. Consequently, the source path treats a boolean direction FALSE as 0 and TRUE as 1. For x=1 the corresponding binary64 references are 0.9999999999999999 and 1. A genuinely empty scalar direction is neither a numeric value nor “+”/"-", so the callback returns #VALUE!. An incoming error propagates through the dispatcher. These are traced source rules, not recorded native coercion tests; arrays, implicit intersections and localized numeric-text parsing are outside the worked controls.

The checked numeric-result constructor maps non-finite results to #NUM! and normalizes signed zero. Do not treat an infinity direction token as a promise that an infinity value can be stored in the worksheet. In particular, stepping outward from the finite maximum reaches a non-finite library result in the binary64 model; the source constructor would convert that result to #NUM!. No installed-build overflow or signed-zero test is claimed.

Advanced use: local sensitivity without a fixed epsilon

Let a test input in F2 be 1. Put =FLT.NEXTAFTER(F2,0) in F3 and =FLT.NEXTAFTER(F2,"+") in F4. Evaluate an expression separately at all three points to examine whether it crosses a threshold at this representable boundary. The binary64 gaps are 2^-53 below and 2^-52 above, so adding and subtracting the same fixed epsilon would not reproduce these exact neighbors.

Repeat with F2 set to 2: the reference gaps double. Repeat with F2 set to -1: use the sign and direction deliberately, because moving upwards is not the same as increasing magnitude. Such a diagnostic can reveal sensitivity in a numerical formula, but one-step perturbations are not measurement uncertainty, a convergence proof or an appropriate business rounding policy. Do not repair a failing comparison by silently moving its input one step.

Version-specific troubleshooting

Gnumeric 1.12.59 release notes explicitly fix the long-double version of FLT.NEXTAFTER. Therefore introduction in 1.12.57 does not establish that this alternate build had correct behavior throughout the interval. The current source maps nextafter through the configured numeric suffix. Binary64 reference values must not be used as exact expected results for long-double or decimal64 builds.

When neighboring values appear identical, inspect their difference and numeric configuration before concluding that the function failed. When an expression is rejected, check the two-argument signature and the exact direction type. Import/export compatibility, cell-display precision and native execution remain separately unverified.