Bug 69701 - EDITING: Error in function GCD_ADD
Summary: EDITING: Error in function GCD_ADD
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Spreadsheet (show other bugs)
Version: 4.1.1.2 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-23 10:32 UTC by John Smith
Modified: 2013-09-24 13:20 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description John Smith 2013-09-23 10:32:34 UTC
Problem description: Entering decimal values into GCD_ADD returns a wrong result when a value greater than 10 is entered.

Steps to reproduce:
1. In a default installation of LibreOffice, open an instance of Calc.
2. Open the Function Wizard
3. Double-click the GCD_ADD function to select it.
4. Enter values such as 2.1, 4.2, 6.4 and 10.5 into the Numbers list.

Current behavior:
The result returned is wrong. Remove the 10.5 value and the result is correctly given as 2.1.

Expected behavior:
The result of 2.1 should be returned for all the example values.
The input parameters are stated to be Numbers, not Integers.
              
Operating System: Windows XP
Version: 4.1.1.2 release
Comment 1 Stanislav Horacek 2013-09-23 16:19:04 UTC
GCD function works only for integers, as it is described in the ODF standard:
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018532_715980110

or in Excel help:
http://office.microsoft.com/en-us/excel-help/gcd-HP005209104.aspx

GCD rounds input numbers down to integer and returns integers, but GCD_ADD apparently returns decimal values - maybe this is a bug.
Comment 2 John Smith 2013-09-23 20:00:23 UTC
Yes. No problem with GCD, only with GCD_ADD.
Comment 3 Stanislav Horacek 2013-09-24 13:20:59 UTC
OK, I confirm this as a bug: GCD_ADD function does not convert input values to integers and returns rationals. E.g.:
GCD_ADD(2.1;4.2) returns 2.1, should return 2
GCD(2.1;4.2) returns 2 correctly

This is probably inherited from OO - see also https://issues.apache.org/ooo/show_bug.cgi?id=71158 where the same behaviour (returning rationals) was corrected for GCD function.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.