Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | Multiple Operations calculations | ||
---|---|---|---|
Product: | Calc | Reporter: | tyleong <tyleong> |
Component: | code | Assignee: | AOO issues mailing list <issues> |
Status: | CONFIRMED --- | QA Contact: | Rob Weir <robweir> |
Severity: | Minor | ||
Priority: | P3 | CC: | issues, rb.henschel, samalipraveena, villeroy |
Version: | OOO320m9 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Latest Confirmation in: | 3.4.1 |
Developer Difficulty: | Simple |
Description
tyleong
2010-05-25 02:12:11 UTC
RANDBETWEEN is implemented in a way, that it does not recalculate automatically. So you have to use a "Recalculate Hard" (Ctrl+Shift+F9) to get new random values. Concerning "multiple operations" I need an example document from you. You can attach it, if you use the link "Create a new attachment" in the issue tracker form. OpenOffice.org does not implement an own random value generator but uses that one, which comes with the compiler. It has only 2^16 different values. Are you sure it is appropriate for a Monte-Carlo simulation? @Regina, I agree with your observation that RANDBETWEEN() does not calculate automatically. But is that a reasonable behavior? RAND() certainly recalculates with every F9. Why should RANDBETWEEN() do differently? Is is just a scaled/translated version of RAND(), right? I'm wonder if this should be confirmed as a DEFECT. Confirming as a DEFECT. I don't see any argument for why RAND() is treated as a volatile function but RANDBETWEEN()is not. regina, rob, I took this task and was looking at the code to find out why RANDBETWEEN is not updated automatically; and another thing is that I couldn’t understand what the user is trying to do. With AOO calc multiple operations, you can input only two sets of data a row and a column for a formula. Can you explain more about this or generate test data, please? In my system, when I press F9 key, it increases the sound, but doesn’t update RAND. However, Ctrl+shift+F9 updates both RAND and RANDBETWEEN() cells. These are the things I got from code: RAND is an OO or built-in function with an opcode defined in compiler.hrc file, which has opcodes for all spreadsheet functions. On the other hand, RANDBETWEEN() is an add-in function and they are not assigned any specific opcodes. As far as I analysed the code, Add-in functions have an opcode of "opexternal". In main/sc/source/core/tool/odffmap.cxx, there is a collection which holds the list of add-in functions in analysis, including RANDBETWEEN; when i searched the code to find out where this collection has been used but not anywhere. The implementation of this function is in main/scaddins/source/analysis - analysis.hxx, analysis.cxx files. In /aoo-trunk/main/formula/source/core/api/FormulaCompiler.cxx, certain functions, including ocRandom-RAND, are set to have to be always recalculated, using the code pArr->SetRecalcModeAlways(); Like ocRandom-RAND, RANDBETWEEN or other add-in functions don’t have any opcode and so they can’t be set to SetRecalcModeAlways and updated automatically; This RecalcModeAlways is not set for Add-in functions, instead like all formula cells it is set to recalconload or recalconloadonce. I have already spent days in this task analyzing the code; can you please tell me your suggestions on this issue? See my comment #1, I too have no idea, what tyleong wants to do with Multiple.Operations. I think, that RANDBETWEEN should stay as it is. It is typically used in education where you want the content of the spreadsheet to be stable until the work of the pupil is done. Users who want to have new random numbers with every cell change, can write their own function using RAND, e.g. =RANDBETWEEN(a;b) equals =INT(RAND()*(b-a+1)+a) In regard to RANDBETWEEN this is duplicate to issue 69903. Find a related patch there. In regard to Multiple Operations "needmoreinfo" keyword would be appropriate. Hi regina, Thanks for your comment. I saw the patch with the issue 69903. It is a patch which affects so many files with so many lines of code. As you said, i'm going to leave this issue as it is. RANDBETWEEN behaves exactly like any other non-volatile spreadsheet function. RANDBETWEEN(A1;B1) automatically recalculates when either one of A1 or B1 changed. Likewise, SUM(1;2;3) never recalculates because constants are constants. Reset the assignee to the default "issues@openoffice.apache.org". |