digitalmars.D.learn - Feature requests
- Spacen Jasset (11/11) Apr 01 2008 I have some features requests, some of which are small. Is there a way
- Derek Parnell (20/20) Apr 01 2008 On Tue, 01 Apr 2008 16:35:30 +0100, Spacen Jasset wrote:
- Spacen Jasset (5/26) Apr 02 2008 Yes, thereby giving answers in terms of float, doublt or real. How would...
I have some features requests, some of which are small. Is there a way that these should be raised? For example, this trivial feature could go in phobos2.std.math and tango: float degToRad(float deg) { return deg * PI / 180; } float radToDeg(float rad) { return (180 * rad) / PI; }
Apr 01 2008
On Tue, 01 Apr 2008 16:35:30 +0100, Spacen Jasset wrote: Or maybe ... enum { fPI_180 = PI / 180.0L; f180_PI = 180.0L / PI; } T degToRad(T)(T deg) { return cast(T)(cast(real)deg * fPI_180); } T radToDeg(T)(T rad) { return cast(T)(cast(real)rad * f180_PI); } -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
Apr 01 2008
Derek Parnell wrote:On Tue, 01 Apr 2008 16:35:30 +0100, Spacen Jasset wrote: Or maybe ... enum { fPI_180 = PI / 180.0L; f180_PI = 180.0L / PI; } T degToRad(T)(T deg) { return cast(T)(cast(real)deg * fPI_180); } T radToDeg(T)(T rad) { return cast(T)(cast(real)rad * f180_PI); }Yes, thereby giving answers in terms of float, doublt or real. How would that be different from just implementing in terms of real anyway. reals can be implictly converted down to a floats anyway, can they not? Seems like I should post this to digitalmars.D
Apr 02 2008