I have a problem where I am taking the sign of a constant that has maximal value in absolute value from a tuple. I need to know how to write this as a formula.
I saw it written in a book as follows, however I don't think that's a proper way, hence this is going to be always positive, right?
$value=sign(h),\ where \ h=max(\left|c1\right|,\left|c2\right|)$
It's a silly question, but I can't find some elegant way to write it.
You are correct that what the book has written is not correct. You could get what you want this way:
t = (c1,c2)h = argmax(|t|)where by $|t|$ we mean the absolute value of each item in $t$. Now,
value = sign(t[h])