I would consider that as the expected behavior, when dealing with a loosely typed language.
w
websolete
11/05/2024, 3:27 PM
so it seems. i just didn't expect to have to treat a number like a string to find out what kind of number it is
t
Tim
11/05/2024, 3:28 PM
yeah. -2.1 can't convert to an integer, so it's not a valid int. But 2.0 can be, so it is.
d
Dave Merrill
11/05/2024, 4:29 PM
Agree, nothing unexpected there.
What do you mean by "what kind of number it is"?
You can figure out if something is an even integer in other ways too, and I'm not sure why you'd want to know that anyway.
w
websolete
11/05/2024, 6:02 PM
i simply have a couple of utility functions, isFloat() and isInteger() which were previously just leveraging isValid() in their bodies. they weren't returning expected results, so i had to rewrite them to ensure they were accurate, rather than justifying it by saying it's just how cf works
d
Dave Merrill
11/05/2024, 7:06 PM
Just curious, what do you do differently based on whether data is an int or a float?
w
websolete
11/05/2024, 7:10 PM
nothing specific, just fleshing out a UDF library to support being able to do so