R.DGEOM Function (Gnumeric)
Calculate geometric probability masses in Gnumeric R.DGEOM. Count failures before the first success, use log masses and verify discrete-count boundaries.
Verification status: 21 reference, boundary and advanced-check formulas were recalculated with Gnumeric 1.12.57 ssconvert. Saved identities, the blank input and numerical results were independently checked. Gnumeric 1.12.62 was source-checked only. How formula examples are checked
Quick answer: =R.DGEOM(0,.2) gives 0.2 in Gnumeric 1.12.57.
Availability and version history
- Introduced: First release not established; present in the retained 1.12.57 source.
- Supported in: Gnumeric 1.12.62; no retirement is established.
- Scope: Desktop Gnumeric with its Statistical Functions From R plugin. English comma-separated formulas are shown.
- Checked: October 14, 2026. Tables and the named advanced check use 1.12.57 ssconvert. Current 1.12.62 source was inspected; that release was not executed.
What R.DGEOM returns
R.DGEOM gives the probability of exactly x failures before the first success in independent trials with a constant success chance p. Its mass is p×(1−p)^x for a nonnegative integer x. Although the built-in help calls it a density, it is a discrete probability mass. Versioned function help.
Syntax and arguments
=R.DGEOM(failures,success_probability[,give_log])
- failures: required count before the first success, starting at 0.
- success_probability: required per-trial chance, with 0<p≤1.
- give_log: optional FALSE; TRUE returns the natural logarithm of the mass.
Brackets mark optional arguments; do not type them. Current worksheet implementation.
Reproducible examples
These self-contained formulas were recalculated natively. Ordinary-domain results were checked against independent mathematics; source guards explain the boundary cases. Results are rounded to twelve decimal places, or thirteen significant digits for small nonzero values. This is presentation precision, not a universal accuracy guarantee.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=R.DGEOM(0,.2) |
0.2 |
=R.DGEOM(3,.2) |
0.1024 |
=R.DGEOM(4,.5) |
0.03125 |
=R.DGEOM(0,1) |
1 |
=R.DGEOM(1,1) |
0 |
=R.DGEOM(3,.2,TRUE()) |
-2.278868566377 |
=R.DGEOM(9,.1) |
0.0387420489 |
=R.DGEOM(0,.2,TRUE()) |
-1.609437912434 |
Practical worksheet
With a 20% success chance on each independent attempt, three failures followed by success has probability 0.2×0.8^3=0.1024. That success occurs on the fourth attempt. To model success on attempt n, pass n−1, rather than n. The first-attempt probability is R.DGEOM(0,0.2)=0.2.
Advanced interpretation and checks
Consecutive positive masses have ratio 1−p, so the stored ratio check gives 0.8. The geometric series sums to one. Its expected failure count is (1−p)/p=4 when p=0.2; the expected attempt number is 5. Summing log masses is useful for a likelihood: failure counts 0, 1 and 3 have joint probability p^3×(1−p)^4 under independent observations.
The saved advanced-check result for =R.DGEOM(3,.2)/R.DGEOM(2,.2) was 0.8.
Boundaries and troubleshooting
The helper rejects p=0, even though the worksheet name may tempt a zero-success limiting interpretation. A genuinely fractional count such as 2.9 produces zero and a retained noninteger-input warning; it is not floored. A very close-to-integer count passes the explicit near-integer tolerance. Impossible events have mass zero, whose log cannot be represented as a finite worksheet number and becomes #NUM!.
F5 is genuinely empty, rather than a cell containing an empty string.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=R.DGEOM(2.9,.2) |
0 |
=R.DGEOM(-1,.2) |
0 |
=R.DGEOM(0,0) |
#NUM! |
=R.DGEOM(0,-.1) |
#NUM! |
=R.DGEOM(0,1.1) |
#NUM! |
=R.DGEOM(1,1,TRUE()) |
#NUM! |
=R.DGEOM(2.000000000000001,.2) |
0.128 |
=R.DGEOM("3",.2) |
0.1024 |
=R.DGEOM("abc",.2) |
#VALUE! |
=R.DGEOM(F5,.2) |
0.2 |
=R.DGEOM(3) |
#N/A |
=R.DGEOM(3,.2,0,1) |
#N/A |
Official evidence and checking scope
- Current worksheet callback
- Tested-version worksheet callback
- Current dgeom calculation
- Tested-version dgeom calculation
- Nonfinite worksheet-value handling
- Statistical Functions From R plugin declaration
- Near-integer tolerance
- Noninteger mass check
The deliberate fractional count/trial probes also emitted noninteger-input calculation warnings. The saved logs retain them.
The relevant complete worksheet callback and main calculation helper are unchanged between the inspected versions. That does not establish later-version numerical execution. Both stale and uncached SUM controls recalculated correctly. Native XML preserves the R.* identities. The secondary ODF export keeps these calls in the ORG.GNUMERIC namespace; it does not establish execution in another product. GUI entry, other locales and other spreadsheet products were not tested.