11-12-2008 12:38 AM
Hai
I want to convert an unsigned decimal no. to Signed Decimal no.How can this be done?For eg. 65516 (Unsigned) represents -20(signed)
Solved! Go to Solution.
11-12-2008 12:48 AM
11-12-2008 12:51 AM - edited 11-12-2008 12:53 AM
Either typecast or convert to I16. See image.

11-12-2008 01:00 AM
11-12-2008 06:06 AM - edited 11-12-2008 06:07 AM
Hello you Knight of NI.
I thought that the question and the answer is so simple that I do not need a screen shot to explain it.
You have stolen my accepted solution and my Kudos
.
And to be honest I never mind about that
.
11-12-2008 09:15 AM
waldemar.hersacher wrote:I thought that the question and the answer is so simple that I do not need a screen shot to explain it.
I am very sorry about that. Of course one might argue that without the picture I would have been more than three minutes faster, beating you for the first answer 😮 🙂
In fact, the answer is quite a bit more complicated, because we were never told what the representation of the original "unsigned decimal" is. Common sense would assume that it's U16, but we cannot be sure.
For example if the input is an U32 number of 65516, the typecast would fail. (The "To I16" conversion bullet and simple coercion would still be OK).