List of QB64 Constants? - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://staging.qb64phoenix.com/forumdisplay.php?fid=10) +---- Thread: List of QB64 Constants? (/showthread.php?tid=348) |
List of QB64 Constants? - dcromley - 05-05-2022 Is there a list of QB64 constants, like _PI=3.14..? Also, 1/0 gives INF and -1/0 gives -INF. Are there INF and -INF constants? This code is just some experimenting (some garbage in the 2nd line of output - no problem). Code: (Select All) DefLng I RE: List of QB64 Constants? - Pete - 05-05-2022 A forum member from that little island country just off to the east of Ireland posted some, here: https://staging.qb64phoenix.com/showthread.php?tid=325&highlight=3.1415 Pete RE: List of QB64 Constants? - bplus - 05-05-2022 I think Inf and -Inf are to indicate over flow errors without erroring out your program. There is also Exp(x) for e^x so e = Exp(1) i for imaginary sq(-1) is not considered by QB64 but someone is sure to have library for complex numbers. Maybe Sprezzo! (Doesn't it look better with an ! at the end?) RE: List of QB64 Constants? - Pete - 05-05-2022 INF (It's not funny?) Maybe change that to INFP, (It's not... possible.) Anyway, I forgot dc also asked about that INF, -IFN stuff. This was not in QBasic, but because QB64 is a C/C++ translator, We see it when we cause a severe math error as trying to divide by zero, or better put... "The C++ infinity is written as "INF" and it accrues in the outcome of dividing a positive numeric value by a null value or calculating a numeric value that is greater than the larger number of our system that can be represented in 64 bits." So INF stands for infinity. Don't even try to define that as a constant. Pete RE: List of QB64 Constants? - dcromley - 05-05-2022 You guys crack me up! @pete What I was interested in is constants defined by QB64 so I wouldn't have to define them. @Sprezzo LOL! @bplus I like the "without erroring out" approach. @pete FWIW, run the code (I don't think it's worth too much) Code: (Select All) DefStr S RE: List of QB64 Constants? - SMcNeill - 05-06-2022 QB64 doesn't have any defined CONST, unless you count the color const which you have to set with $COLOR. |