cockroachdb / cockroachdb/cockroach
float exp/degrees return Inf/0 on overflow instead of PG range error
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Lineage**
- Original: #122879
- Fix: #169869 FloatPow — reject invalid power and finite→Inf/0 overflow
- Gap: exp() / degrees() still use bare math.Exp / scale with no overflow check
**To Reproduce** (v25.2.0)
```sql
SELECT exp(710::float8); -- Infinity; PG: overflow
SELECT exp(-746::float8); -- 0; PG: underflow
SELECT degrees(1e308::float8); -- Infinity; PG: overflow
Jira issue: CRDB-66922
Contributor guide
Research direction
Start by running the three SQL reproductions for exp() and degrees(), then locate their implementations and compare the bare math.Exp/scale behavior with FloatPow's overflow handling. Done means finite-to-Infinity and finite-to-zero overflow cases return PostgreSQL-compatible range errors rather than Infinity or 0.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100