Custom Exponents
Ali Çehreli
acehreli at yahoo.com
Sat Dec 14 21:36:34 PST 2013
On 12/14/2013 09:22 PM, Malkierian wrote:
> Alright, so I'm trying to do hex string to integer conversion, but I
> can't for the live of me find how to do exponent calculation in D. Java
> has a Math.pow() function that allows you to specify the base and the
> exponent, but all I've seen in D's libraries are functions that allow
> you to only specify the exponent and does it on a predetermined base,
> such as 2, e or 10. I need 16 for the base.
There is an operator for that: :)
assert(16 ^^ 2 == 256);
Ali
More information about the Digitalmars-d-learn
mailing list