Re: Custom Exponents

2013-12-15 Thread Marco Leise
Am Sun, 15 Dec 2013 06:22:45 +0100 schrieb "Malkierian" : > 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

Re: Custom Exponents

2013-12-15 Thread Marco Leise
Am Sun, 15 Dec 2013 13:52:55 +0100 schrieb Philippe Sigaud : > > - > > void main() > > { > > int a = 2, b = 2; > > auto c = a ^^ b; > > } > > - > > > > test.d(6): Error: must import std.math to use ^^ operator > > ?? The ^^ operator is defined in std.math? dmd lacks a native impl

Re: Custom Exponents

2013-12-15 Thread Philippe Sigaud
> - > void main() > { > int a = 2, b = 2; > auto c = a ^^ b; > } > - > > test.d(6): Error: must import std.math to use ^^ operator ?? The ^^ operator is defined in std.math? > Side-note: Importing std.stdio implicitly imports std.math, so you > won't have any errors (boy do I hat

Re: Custom Exponents

2013-12-15 Thread Andrej Mitrovic
On 12/15/13, Philippe Sigaud wrote: >> >> http://dlang.org/phobos/std_math.html#.pow >> >> See the fourth overload: `if (isFloatingPoint!F && isFloatingPoint!G)`. > > Is there any difference between using `a ^^ b` and `pow(a,b)`? Depends on whether the arguments are known at compile-time, and the

Re: Custom Exponents

2013-12-14 Thread Philippe Sigaud
> > http://dlang.org/phobos/std_math.html#.pow > > See the fourth overload: `if (isFloatingPoint!F && isFloatingPoint!G)`. Is there any difference between using `a ^^ b` and `pow(a,b)`?

Re: Custom Exponents

2013-12-14 Thread Malkierian
On Sunday, 15 December 2013 at 05:39:03 UTC, Nathan M. Swan wrote: 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 sp

Re: Custom Exponents

2013-12-14 Thread Nathan M. Swan
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 a

Re: Custom Exponents

2013-12-14 Thread Ali Çehreli
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 librarie

Re: Custom Exponents

2013-12-14 Thread Malkierian
On Sunday, 15 December 2013 at 05:22:47 UTC, 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'

Custom Exponents

2013-12-14 Thread Malkierian
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 s