Precision - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: Chatting and Socializing (https://staging.qb64phoenix.com/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://staging.qb64phoenix.com/forumdisplay.php?fid=2) +--- Thread: Precision (/showthread.php?tid=1172) |
RE: Precision - mnrvovrfc - 11-22-2022 For more-accurate solutions, greater strength might be needed instead of "MOD": https://www.unix.com/man-page/linux/3/fmod/ Likely the "fmodl()" out of them. Some of the variables then have to be declared _INTEGER64 and others _DOUBLE or _FLOAT. RE: Precision - Pete - 11-22-2022 (11-22-2022, 09:08 PM)Chris Wrote: How to apply dec float here? It only gives part of the code. Try here... https://staging.qb64phoenix.com/showthread.php?tid=886&pid=7813#pid7813 RE: Precision - bplus - 11-22-2022 (11-22-2022, 09:08 PM)Chris Wrote: How to apply dec float here? It only gives part of the code. All those Integer conversions suggest to me you are looking for _INTEGER64 Type for for maximum Integer range. RE: Precision - Chris - 11-22-2022 I have a # sign in my code next to each variable and there are errors. For the needs of the Forum, I have removed them. So, it is about floating point and xintegrate values depending on the formula. RE: Precision - Chris - 11-22-2022 _DEFINE A-Z AS _FLOAT did not help RE: Precision - Chris - 11-22-2022 All those Integer conversions suggest to me you are looking for _INTEGER64 Type for for maximum Integer range. And the results of this is? RE: Precision - Chris - 11-22-2022 To sum up, in order not to extend it, write like this: A ## = b ## / 548 * C ## So double sign. I'll check tomorrow. I am after 10 PM RE: Precision - mnrvovrfc - 11-22-2022 Out of this code: Code: (Select All) DIM li AS _INTEGER64 I get a "D+18" at the end of "lf" value. This was one less than the positive maximum value of 64-bit integer. I notice your calculations need negative numbers and that's why I tried previously with 18 trilliard and got instead "D+19" from the _FLOAT variable. If only you could make sure you don't need a fractional part anywhere in your calculations, use _INTEGER64. This is because you said something about the astronomer and usually it means accuracy that could be offered by the "string math" solutions sprinkled on this forum. The "string math" is harder to program, indeed but gives much better accuracy for very small numbers than any simple variable storage type in any "unmanaged" programming language. RE: Precision - bplus - 11-22-2022 (11-22-2022, 09:08 PM)Chris Wrote: How to apply dec float here? It only gives part of the code. Really this chunk of code is missing allot of values that QB64 will assume as 0 if we just tested this part. Where did this code come from? If some language with arbitrary large integers like Python then need string math. Anyone see the calculations for Easter, this looks like Easter on a planet not in our solar system with q moons ;-)) RE: Precision - Kernelpanic - 11-23-2022 Quote:rplus1 = c1plus1 MOD 1095 What shoud that? What is c1plus1, c1minus1, V1, V1plus1, qplus1, . . . And mnrvovrfc is right: use DIM and Option _Explicit, otherwise the DIM has practically no value. |