If a human can rewrite code from one language to do the same thing in another language, it's definitely possible to automate. But I acknowledge that translation will be very difficult to achieve. Saying something is impossible because it's very hard is ultimately self-limiting.
-
-
And obviously the fact that it rounds the index after sufficient decimal points is idiotic too... I've had some similarly intractable nonsense happening too occasionally.
-
Yeah, I'd guess there is no explicit epsilon for that indexing check -- it's just using the limit of double accuracy to work out whether it's an integer. I assume this can produce some wacky behaviour for Large arrays.
-
In my case it has been the opposite where it claimed a variable was a certain integer, say 3, but x==3 would be false. Has produced some very annoying bugs...
-
But at least the isinteger thing is internally consistent. It's not checking whether a number is an integer but whether the variable you input is... Of course there really should be a function to also do that with numbers (not sure, perhaps there is?)
-
Hmm... isn't Matlab dynamically typed so what does type-checking like that actually help with?
-
Not sure I understand what you mean. You can have a variable that is an integer type (say uint8 which is basically a byte with 0-255). The function checks if it is an integer variable.
-
- 9 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

