Bug 151165 - [EDITING] [DOCUMENTATION] ISODD and ISEVEN behavior
Summary: [EDITING] [DOCUMENTATION] ISODD and ISEVEN behavior
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Eike Rathke
URL:
Whiteboard: target:7.5.0
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-24 22:57 UTC by SheetJS
Modified: 2022-09-25 16:08 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SheetJS 2022-09-24 22:57:05 UTC
Description:
ISODD is documented in the function wizard as

> Returns TRUE if value is an odd integer

The assumption, based on the text, is that ISODD returns FALSE if the value is not an odd integer.

There are a few cases that are inconsistent with the body text:

1) `ISODD(7.262)` is TRUE, but `7.262` is not an integer

2) `ISODD("7.262")` is Err: 504

What is the intention of ISODD (and ISEVEN) ?  If the behavior is expected, the documentation should be rewritten.

Steps to Reproduce:
Enter the formula `=ISODD(7.262)` in a cell

Actual Results:
TRUE

Expected Results:
FALSE


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Excel notes the miscellaneous behavior in the docs:

> If number is nonnumeric, ISODD returns the #VALUE! error value.

Curiously, it does not use the word "integer" in the description:

> Returns TRUE if number is odd, or FALSE if number is even.

But it does include an example that makes the definition clear:

> `ISODD(2.5)` "Checks whether 2.5 is odd" FALSE
Comment 1 Eike Rathke 2022-09-25 11:31:05 UTC
The help documentation
https://help.libreoffice.org/7.4/en-US/text/scalc/01/04060104.html?DbPAR=CALC#bm_id3156034
says "If Value is not an integer any digits after the decimal point are ignored. The sign of Value is also ignored."
and that is what happens.

Function Wizard wording is wrong.
Comment 2 Commit Notification 2022-09-25 15:40:43 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7dca847f07c57591d20b6a2c618bfd8bfe62a09f

Resolves: tdf#151165 Function Wizard: ISODD()/ISEVEN() truncate to integer

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.