[Bug 55185] New: vbscript round does not handle numdecimalplaces argument
https://bugs.winehq.org/show_bug.cgi?id=55185 Bug ID: 55185 Summary: vbscript round does not handle numdecimalplaces argument Product: Wine Version: 8.11 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs(a)winehq.org Reporter: jsm174(a)gmail.com Distribution: --- We just found an issue where round wasn't returning expected values when using the `numdecimalplaces` argument. After looking at `Global_Round`, the second argument is not even looked at. As a test, I modified the code to use: `VarR8Round` which seems to work well: ``` int decimal_places = 0; double n; double n2; HRESULT hres; . . . if (args_cnt > 1) { if (V_VT(args+1) != VT_ERROR) { hres = to_int(args+1, &decimal_places); if (FAILED(hres)) return hres; } } hres = VarR8Round(n, decimal_places, &n2); if(FAILED(hres)) return hres; return return_double(res, n2); ``` -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55185 --- Comment #1 from Nikolay Sivov <bunglehead(a)gmail.com> --- As it happens, VarR8Round() itself is broken, it returns -2.0 for {-3.5,0} input. We'll need to fix that first. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55185 --- Comment #2 from Nikolay Sivov <bunglehead(a)gmail.com> --- Created attachment 75542 --> https://bugs.winehq.org/attachment.cgi?id=75542 tests Attaching some tests. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55185 Robert Wilhelm <sloper42(a)yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sloper42(a)yahoo.com --- Comment #3 from Robert Wilhelm <sloper42(a)yahoo.com> --- Created attachment 75547 --> https://bugs.winehq.org/attachment.cgi?id=75547 VarR8round: round -x.5 to next even number. I think we have to change the sign for -0.5 case. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55185 Robert Wilhelm <sloper42(a)yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #4 from Robert Wilhelm <sloper42(a)yahoo.com> --- https://gitlab.winehq.org/wine/wine/-/merge_requests/4534 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55185 --- Comment #5 from Nikolay Sivov <bunglehead(a)gmail.com> --- (In reply to Robert Wilhelm from comment #4)
Thanks, Robert. This is merged now. Could you please submit the vbscript part too? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55185 --- Comment #6 from Robert Wilhelm <sloper42(a)yahoo.com> --- OK, I will submit MR for vbscript part using Jason“s and your work. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55185 Robert Wilhelm <sloper42(a)yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch --- Comment #7 from Robert Wilhelm <sloper42(a)yahoo.com> --- https://gitlab.winehq.org/wine/wine/-/merge_requests/4569 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55185 Robert Wilhelm <sloper42(a)yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #8 from Robert Wilhelm <sloper42(a)yahoo.com> --- Fixed by 0d6c905add980db7902164d59576977d41b9230d and 369b540abf32869df8e9b28e283d795ae92b6a05. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=55185 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #9 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 9.0-rc1. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla