change sign (positive to negative)?
Is there a faster way of doing this?
Many thanks in advance
[expr 0-$i1] ?
I guess
Cleaner at least :/
why not [* -1.] ?
there we go :)
BTW, are you implying that [*1] would change type?
I would imply that [*1] is not a Max object ;)
For handling both int and float without conversion you'd need something like this.
broc - thats simply disgusting. Nothing on you, but I cannot stand this type conversion nonsense.
Many thanks for the ! stuff tho, very useful
"[expr 0-$i1] ?"
[expr -$i1] would be much shorter.
-110
@jamesson — My advice is to either figure out a way to stop being bothered by Max's data type rules, or find a different language that has rules you like better. It's not "disgusting," "nonsense" or "stupid." It's just the way it is, and will probably never change, so learn to tolerate it or move on.
Max was just designed with a different set of assumptions than the ones that you seem comfortable with.
@Chris, yes I know my whining is unappetizing :). I like things to make sense, especially when they're made by human beings who should know better :). I'll stop now :).
But the Max data type rules do make sense. They are consistent, well documented, and loosely based on older standards for strongly typed languages. (e.g. C, C++)
They just don't seem to be based on paradigms that you like.
If by "like" you mean "expect them to relate directly to real math", then, yes I do not "like" them.
IMHO having to relearn math to learn programming is kind of a bummer.
As would be having to relearn programming if learning to program Max. (if coming from a strongly typed language)
And there's the rub. I'd like to have Max be as accessible to non-programmers as possible. I know that's not in the roadmap, but that's my preference.
I understand that (from a beginners POV), but at this point in time, I'd rather Max be compatible with the decades of Max patches in existence.