Precision - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2) +--- Thread: Precision (/showthread.php?tid=1172) |
RE: Precision - Chris - 11-23-2022 Thanks for the hints. After looking at the formulas, I came to the conclusion that the calculations are basically on whole numbers. "Bplus" are not Easter formulas. It is recommended that the calculations are as precise as possible, because the results may be distorted. Someone told me (except Forum) that at least 32-bit precision must be used. I don't really understand what the 32-bit presidency means. Regards Chris RE: Precision - bplus - 11-23-2022 (11-23-2022, 04:22 PM)Chris Wrote: Thanks for the hints. After looking at the formulas, I came to the conclusion that the calculations are basically on whole numbers. "Bplus" are not Easter formulas. It is recommended that the calculations are as precise as possible, because the results may be distorted. Someone told me (except Forum) that at least 32-bit precision must be used. I don't really understand what the 32-bit presidency means. Ah it is Integers! sorry I was having a little fun about Easter calculations. You could then try at start Code: (Select All) _DEFINE A-Z AS _INTEGER64 You would have 64 bit Integer range which should be better than 32 bit, even more if knew all were positive even in sub calculations but probably not likely Code: (Select All) _DEFINE A-Z AS _UNSIGNED _INTEGER64 But your block of code is missing many variable values, not testable even if we knew what an answer looked like. We have to know the meaning of variables to assign the correct type. RE: Precision - Chris - 11-23-2022 q and r -> is an integer. So v1 is also an integer. RE: Precision - Kernelpanic - 11-23-2022 I find the whole thing pretty silly now. Are this about the launch datas of a rocket on a secret mission: "Oops, where did that come from?". The CIA laughs and the recipient is amazed! q and r -> is an integer. So v1 is also an integer. -> Worthless! Seriously, without any indication of the meaning of it all, without concrete data and what is expected as a result, nothing can be meaningfully tested. RE: Precision - mnrvovrfc - 11-23-2022 That's why I suggested to @Chris to run the code he has if possible. Maybe put in "PRINT" statements to figure out what values are assigned to which variables. If this is too hard, run the code in QB64 IDE and put variable watch breakpoints. I don't know how to do that since I use the IDE only for code formatting and to execute very simple programs. At first assume all variables are type _INTEGER64. If the "final" result is zero then at least one of the variables has to be assigned something useful. He has to test to make sure there are no negative integers involved, then in which case the positive range of _INTEGER64 could be doubled to _UNSIGNED _INTEGER64. However, if he requires fractional parts anywhere in the computations then this explanation has to be thrown out the window. There's a lot of "INT" and "MOD" usage so we could almost assume only large integers are being involved. Assume because Chris is not telling us if he ever tried to run his code and how. RE: Precision - Jack - 11-24-2022 @Chris, I am curious what your program is all about, please share it but here's a tip that may help, since your program uses many constants append the && suffix to your constants, that way they will be treated as 64-bit integers, without the suffix it's probably interpreted as a single or 16-bit integer so besides declaring your variables as _Integer64 use the && suffix for the constants so instead of rplus1 = c1plus1 MOD 1095 you have rplus1 = c1plus1 MOD 1095&& -- edit -- you may also try integer division, so instead of v1 = 32336 * q + INT((15 * q + 765433 * R + 12084) / 25920) you have v1 = 32336&& * q + (15&& * q + 765433&& * R + 12084&&) \ 25920&& RE: Precision - Chris - 11-24-2022 Thank You very much. In fact, adding && helped a lot. Subject solved. I would like to thank all participants of the discussion for their help. "I am curious what your program is all about, please share it". Part of the Hebrew calendar code. Regards - Chris RE: Precision - Kernelpanic - 11-24-2022 (11-24-2022, 07:06 PM)Chris Wrote: Part of the Hebrew calendar code. And that is secret? And what does that have to do with astronomy? RE: Precision - Chris - 11-27-2022 It has a lot to do with astronomy, a lot. Read how the calendar works. Regards - Chris RE: Precision - Kernelpanic - 11-27-2022 (11-27-2022, 07:01 PM)Chris Wrote: It has a lot to do with astronomy, a lot. Read how the calendar works. I completely overlooked the "Hebrew calendar". That looks really complicated. I found a page here showing the calendar in a browser using XSLT. Mit dem hebräischen Kalender arbeiten And here is a guide on how to calculate the date. . . let's see, interesting job. Hebräischer Kalender |