Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Determine a value is INTEGER
#9
strange programming system. i ran my own test.

Code: (Select All)

DIM nf AS SINGLE, ni AS _INTEGER64, tol AS _INTEGER64
nf = 10000.0
ni = 10000
tol = 1E+10
IF FIX(nf * tol) = ni * tol THEN PRINT "They are basically equal."
PRINT FIX(nf * tol)
PRINT ni * tol

the message is not printed in program run. change function to INT, however and it is "fixed." also note that in both cases, the function result printed is "1E+14". it might be i'm running qb64 phoenix 3.11 and should upgrade and try again. then i could put double ampersand on the two variables declared _integer64.

in one program i wrote. i was forced to do a lot like pete. turn it into string and check to see if there's decimal point or "E-" or "D-". this was to create lisp-like code which only knows "E" instead of "D" for scientific notation.
Reply


Messages In This Thread
Determine a value is INTEGER - by TerryRitchie - 07-25-2024, 07:40 PM
RE: Determine a value is INTEGER - by DSMan195276 - 07-26-2024, 12:17 AM
RE: Determine a value is INTEGER - by Pete - 07-26-2024, 12:23 AM
RE: Determine a value is INTEGER - by DSMan195276 - 07-26-2024, 02:33 AM
RE: Determine a value is INTEGER - by Pete - 07-26-2024, 02:41 AM
RE: Determine a value is INTEGER - by Jack - 07-26-2024, 12:25 PM
RE: Determine a value is INTEGER - by Petr - 07-26-2024, 03:02 PM
RE: Determine a value is INTEGER - by hsiangch_ong - 07-26-2024, 04:14 PM
RE: Determine a value is INTEGER - by Jack - 07-26-2024, 05:25 PM
RE: Determine a value is INTEGER - by DSMan195276 - 07-26-2024, 07:02 PM
RE: Determine a value is INTEGER - by Jack - 07-26-2024, 08:14 PM
RE: Determine a value is INTEGER - by Kernelpanic - 07-26-2024, 10:57 PM
RE: Determine a value is INTEGER - by DSMan195276 - 07-27-2024, 04:30 AM
RE: Determine a value is INTEGER - by Kernelpanic - 07-27-2024, 05:03 PM
RE: Determine a value is INTEGER - by SMcNeill - 07-27-2024, 01:49 PM
RE: Determine a value is INTEGER - by bplus - 07-27-2024, 02:43 PM



Users browsing this thread: 4 Guest(s)