Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

qbern() returns incorrect quantile for p = 0.1 when prob = 0.9 #34

@Tanjib423

Description

@Tanjib423

Description:
The qbern() function appears to return 1 instead of 0 for the input p = 0.1, prob = 0.9, and lower.tail = TRUE. Based on the Bernoulli CDF, the expected result is 0, as P(X <= 0) = 0.1 satisfies the condition F(q) >= p.

Steps to Reproduce:

library(extraDistr)
qbern(p = 0.1, prob = 0.9, lower.tail = TRUE)
# Expected output: 0
# Actual output: 1



#################
R version: 4.1.2
Package version: 1.9.1
Operating system: Windows 10 x64 build 22631
################

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions