When I did my IP subnet calculator, there were some things that required binary, like determining what part of the IP address was the network address, and other operations required decimal. Of course, that was a unique problem as each octet is a discreet value, and not part of a *total* address. It's actually 2 addresses, the bit length of each defined by the mask. Still, when I needed to do calculations, I needed to do them in decimal.
> > On May 3, 2016, at 9:32 AM, dunbarx <[hidden email]> wrote:
> > Richmond.
> > LC cannot add "20F" to "4CD". You need to use "baseConvert". Not onerous
> > all, really.
> put baseConvert(baseConvert("20F",16,10) + baseConvert("4CD",16,10),10,16)
> On May 3, 2016, at 11:13 AM, Thierry Douez <[hidden email]> wrote:
> and with a bit of factoring...
> put addHex( "20F", "4CD")
> function addHex v1, v2
> local d1, d2
> put baseConvert( v1,16,10) into d1
> put baseConvert( v2,16,10) into d2
> return baseconvert( d1 + d2, 10, 16)
> end addHex
Well done, Thierry!
Office of Digital Humanities
Brigham Young University