Custom Exponents

Nathan M. Swan nathanmswan at gmail.com
Sat Dec 14 21:39:02 PST 2013


On 12/14/13 8: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.

http://dlang.org/phobos/std_math.html#.pow

See the fourth overload: `if (isFloatingPoint!F && isFloatingPoint!G)`.

NMS


More information about the Digitalmars-d-learn mailing list