Skip to content

[fix](doc) log10.md: NaN / 0 / negative inputs return NULL, not NaN#3809

Open
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/log10-en-nan-returns-null
Open

[fix](doc) log10.md: NaN / 0 / negative inputs return NULL, not NaN#3809
boluor wants to merge 1 commit into
apache:masterfrom
boluor:fix/log10-en-nan-returns-null

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 26, 2026

Summary

Doc page (4.x): `scalar-functions/numeric-functions/log10.md` (EN + ZH).

Both pages claimed in their Return Value section, and the EN page additionally claimed in its example block, that `log10(NaN)` returns `NaN`. On Apache Doris 4.1.1 the cluster actually returns `NULL`. The same applies to `log10(0)` and `log10()`.

Update:

  • EN: change the example's expected output `NaN` → `NULL`.
  • EN + ZH: rewrite the return-value bullet to cover NaN, zero, and negative inputs (all return NULL).

Verification

```
mysql> select log10(cast('nan' as double)); -- NULL
mysql> select log10(0.0); -- NULL
mysql> select log10(-1); -- NULL
mysql> select cast('nan' as double); -- NaN (the cast itself preserves NaN; log10 consumes it and returns NULL)
```

Test plan

  • Run each affected SELECT on a 4.1.1 cluster — all return NULL.
  • Cast-only check shows NaN is preserved as a double, but log10 returns NULL.
  • No SQL or example removed.

🤖 Generated with Claude Code

…t NaN

Both the EN page (in the example block) and both pages (in the return-
value spec) claimed that log10 of NaN returns NaN. On Apache Doris
4.1.1 the cluster actually returns NULL for log10 of NaN, log10 of 0,
and log10 of negative numbers. Update:

- EN: change the example's expected output `NaN` -> `NULL`.
- EN + ZH: rewrite the return-value bullet to cover NaN / zero /
  negative all returning NULL.

Verified on the cluster:

    log10(cast('nan' as double)) -> NULL
    log10(0.0)                   -> NULL
    log10(-1)                    -> NULL

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant