On 04/27/2018 02:41 AM, Alex Tweedly via use-livecode wrote:
I should know this - but don't any more :-)
So there may be a corner case to fix up - but in general, something like
*put*thetextoffld"F"intotemp*
put*baseconvert(temp,16,10) intot1*
if* t1 > 32767*then*
*put*t1-65536intot1*
end* *if*
Alex ,
You got it !
I forgot the > 32767 !!
Great thanks
Camm
- Original Message -
From: "Alex Tweedly via use-livecode"
To: use-livecode@lists.runrev.com
Cc: "Alex Tweedly"
Sent: Friday, 27 April, 2018 10:41:27 AM
Subject: Re: Hex to Decimal 2s Complement
I
uot;Richmond"
Sent: Friday, 27 April, 2018 10:22:36 AM
Subject: Re: Hex to Decimal 2s Complement
I think you will have to perform several operations here:
1. convert Hex number to Binary number.
2. find Complement of Binary number.
3. convert Complement to Decimal number.
Your "main pr
ay, 27 April, 2018 10:22:36 AM
Subject: Re: Hex to Decimal 2s Complement
I think you will have to perform several operations here:
1. convert Hex number to Binary number.
2. find Complement of Binary number.
3. convert Complement to Decimal number.
Your "main problem" is that YOU hav
e-livecode"
To: "Camm via use-livecode"
Cc: "Richmond"
Sent: Friday, 27 April, 2018 10:11:19 AM
Subject: Re: Hex to Decimal 2s Complement
Well, unless you can explain to me what "2s Complement" means I cannot
help you.
Richmond.
On 27.04.2018 12:06, Camm via use
result for 2s Complement.
>
> Regards
> Camm
>
> - Original Message -
> From: "Richmond via use-livecode"
> To: "Camm via use-livecode"
> Cc: "Richmond"
> Sent: Friday, 27 April, 2018 10:01:17 AM
> Subject: Re: Hex to Decimal 2s Co
ot;Richmond via use-livecode"
To: "Camm via use-livecode"
Cc: "Richmond"
Sent: Friday, 27 April, 2018 10:01:17 AM
Subject: Re: Hex to Decimal 2s Complement
Check out *baseConvert* in the dictionary.
Richmond.
On 27.04.2018 11:50, Camm via use-livecode wrote:
Hi ,
Richmond ,
Tried baseconvert but could not get the correct result for 2s Complement.
Regards
Camm
- Original Message -
From: "Richmond via use-livecode"
To: "Camm via use-livecode"
Cc: "Richmond"
Sent: Friday, 27 April, 2018 10:01:17 AM
Subject: Re
Check out *baseConvert* in the dictionary.
Richmond.
On 27.04.2018 11:50, Camm via use-livecode wrote:
Hi ,
Help needed on the most efficient way to convert signed Hex to Decimal (2s
Complement) range -
Example :-
FFCC = -52
014A = 330
Kind Regards
Camm
Hi ,
Help needed on the most efficient way to convert signed Hex to Decimal (2s
Complement) range -
Example :-
FFCC = -52
014A = 330
Kind Regards
Camm
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit
10 matches
Mail list logo