i'm confused i guess. are these expected results?...
# cfml-general
w
i'm confused i guess. are these expected results? note the items i marked with a /// ? : https://trycf.com/gist/741ede4d9b89689b6531375517f70657/lucee6?theme=monokai
m
I would consider that as the expected behavior, when dealing with a loosely typed language.
w
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
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
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
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
Just curious, what do you do differently based on whether data is an int or a float?
w
nothing specific, just fleshing out a UDF library to support being able to do so