While browsing my code in a weakly-typed language I was seeing that I've trained myself to use identity (
===) where logical. Then I came across a greater (or less) than or equal to (
>=), and it made me wonder... why is there no "greater than or identical to"? I suppose it would be
>==. For example...
5 == 5 // true 5 === 5 // true 5.5 >= 5 // true 5.5 >== 5 // false 6 >= 5 // true 6 >== 5 // true
Basically, I would throw a false if it was of a different type. For example, if I want to check if $x is greater than $y, but I want them both to be integers (or floats, but no mixing), then wouldn't it make sense to have a single call that can do all that, rather than having to check separately to see if they were the same type?
A quick google indicated that this may not exist in any language; why not? Is it just not as useful as I might think it is? :)