Commit graph

50 commits

Author SHA1 Message Date
k-hara
e7b3d834d7 detab and remove trailing whitespaces 2015-02-10 00:56:40 +09:00
Robert burner Schadek
90152e76fb example moved fom comment to unittest 2015-01-20 13:21:59 +01:00
Ilya Yaroshenko
c8d9afedea clean scope imports
imports of `std.range, std.algorithm, std.array, std.string,
std.format, std.uni` are affected.
2014-11-21 00:08:35 +03:00
H. S. Teoh
31fa941b65 Fix missing local import in std.math.expi. 2014-11-17 10:51:41 -08:00
Ilya Yaroshenko
83f9e0fbef std.complex: clean imports 2014-11-14 14:59:16 +03:00
Ilya Yaroshenko
bb98c11236 std.complex: clean imports 2014-11-07 00:40:19 +03:00
Martin Nowak
5f9b77a5b7 Merge pull request #2637 from 9il/fptemp
remove FPTemporary usage
2014-11-06 15:19:42 +01:00
jmdavis
76df657bb4 Move some deprecations along. 2014-10-26 19:31:08 -07:00
Ilya Yaroshenko
9b20fb00b3 remove FPTemporary usage 2014-10-25 00:43:27 +04:00
Jean-Loup Tastet
3b2fb2ea51 Enhancement request 13022: add std.complex.sqAbs
Add `std.complex.abs2`, which returns the squared modulus of a
`Complex` or real number.

Rationale:
* It is common to need the squared modulus of a complex number,
and using `abs(z)*abs(z)` would be inefficient due to the
computation of the square root.
* The name `abs2` has been chosen for consistency with `abs`, and
for being mathematically more correct than `norm`, used by C++ STL
for the equivalent function.
* For genericity, the function `abs2` is also declared for real
floating point numbers, in which case it simply returns its
square.

UPDATE: use `sqAbs` instead of `abs2`.
2014-07-03 18:47:06 +02:00
k-hara
c90ef1b823 Mark some unittest blocks deprecated to suppress messages during Phobos build 2014-06-29 15:52:06 +09:00
monarch dodra
dbf108b451 Merge pull request #2145 from WalterBright/nogc-complex
@nogc for std.complex
2014-05-19 15:57:52 +02:00
monarchdodra
d609bd332f Sed "@safe pure nothrow" 2014-05-06 08:21:13 +02:00
Walter Bright
06005934ea @nogc for std.complex 2014-05-05 23:14:28 -07:00
Marc Schütz
f94f858661 Remove DDOC comment from deprecated Complex(T).toString() with sink and format string 2014-04-28 22:16:25 +02:00
k-hara
b391b2ec9f Convert to new alias syntax 2014-02-11 15:27:05 +09:00
Joseph Rushton Wakeling
8e26e2d8ce Complex.opBinaryRight for numeric types, to allow numeric ^^ complex operations.
The current design takes advantage of the fact that we know
we're dealing with a number whose argument is either 0 or PI.
An alternative design would be to just create a complex number
whose real part is equal to the input, and then raise it to
the power of this:

    return typeof(return)(lhs, 0) ^^ this;

This would generate probably less precisely calculated values
but would be 100% consistent with complex ^^ complex calculations.
2013-12-09 16:18:11 +01:00
Joseph Rushton Wakeling
1d04bb2883 Correct docs & deprecation message in std.complex.
Reference to std.format.format [sic!] should be to std.string.format.

I've also taken the opportunity to slightly clean up the module's
import statements and some whitespace errors.
2013-11-27 19:48:54 +01:00
H. S. Teoh
3bdb1a1a04 Add TODO to make toString() pure @safe nothrow
I tried each of those qualifiers but none of them compiled due to the
way std.format works right now. So leave it for the future.
2013-08-29 08:13:18 -07:00
H. S. Teoh
108e223aa8 Add deprecation date.
Improve documentation for new toString.
2013-08-28 09:47:39 -07:00
H. S. Teoh
fe75e2da57 Implement toString that supports %f. 2013-08-27 15:06:59 -07:00
Maksim Zholudev
494e6bd35e Improved unittest 2012-12-13 14:20:48 +01:00
Maksim Zholudev
b5ff933a19 Added unittest 2012-12-13 10:44:32 +01:00
Maksim Zholudev
7a7aeb7eb3 Added initialization of e.g. Complex!double with Complex!real 2012-12-12 14:48:17 +01:00
Maksim Zholudev
14d3359396 Fixed for the case of different types of real and imaginary parts. 2012-12-12 14:40:32 +01:00
Maksim Zholudev
1970cb6cc6 Added possibility to initialize complex numbers with "real" types 2012-12-12 14:29:50 +01:00
Lars T. Kyllingstad
029440c2f9 Removed asm code from std.complex.expi() 2012-05-11 19:08:12 +02:00
Lars T. Kyllingstad
c80bb85897 std.complex: Minor doc improvement 2012-05-01 11:54:56 +02:00
Lars T. Kyllingstad
03295d1ebc Added std.complex.expi()
Also added Don as author, since there are several functions in
std.complex, including expi(), that are copied more or less verbatim
from std.math.
2012-05-01 10:44:15 +02:00
Lars T. Kyllingstad
34bc329af8 std.complex: Cleanup
Moved some stuff around, removed some extraneous whitespace, made
function documentation more consistent.
2012-05-01 10:27:26 +02:00
Lars T. Kyllingstad
5b4351d425 std.complex: Moved abs, arg & conj to module level
Backwards compatibility is preserved through the magic of UFCS.
2012-05-01 10:10:30 +02:00
k-hara
1673bc594e fix sink to scope 2011-09-05 09:32:29 +09:00
Lars T. Kyllingstad
69e8663fc1 Add sin(), cos() and sqrt() to std.complex
This also requires std.math.coshisinh() to be accessible to std.complex,
so I changed its protection attribute to "package".
2011-08-24 14:55:45 +02:00
jmdavis
302323559a Revert "not really pure"
This reverts commit 4f28db6ffb.

Since Walter put weakly pure back in, these changes need to be undone.

Conflicts:

	std/datetime.d
2011-07-07 01:40:07 -07:00
Walter Bright
4f28db6ffb not really pure 2011-06-25 19:58:09 -07:00
Lars T. Kyllingstad
02e88f30eb Make complex() @safe pure nothrow 2011-06-13 19:10:05 +02:00
Lars T. Kyllingstad
f7c2582eec Improved complex() examples 2011-06-13 19:06:05 +02:00
Lars T. Kyllingstad
cf88c755b6 Add std.complex.complex() 2011-06-13 17:32:41 +02:00
Lars T. Kyllingstad
6462b0cfaa Complex: opAssign and opOpAssign return by ref
This was impossible earlier due to bug 2460, which has now been fixed.
2011-04-26 18:44:17 +02:00
Walter Bright
046e1b36db add source links 2011-02-06 15:46:50 -08:00
Lars T. Kyllingstad
ad2f13cc8a All of std.complex (except toString()) is now @safe pure nothrow. 2010-11-12 07:53:40 +00:00
Walter Bright
b8ce58ccd1 detab sources 2010-08-23 02:14:45 +00:00
Lars T. Kyllingstad
4de804f614 Applied pure and nothrow to std.complex. To make this work, I had to add a few nothrows to std.math.pow() as well. 2010-08-13 09:58:13 +00:00
Lars T. Kyllingstad
2b4433e174 Changed Complex.toString() to take a delegate, and also to allow calling it without parameters. 2010-07-14 11:36:07 +00:00
Andrei Alexandrescu
536cb93d9c Fixed issue in Appender 2010-07-06 05:34:59 +00:00
Walter Bright
f18ec20cb4 update for change in opOpAssign 2010-05-22 01:38:28 +00:00
Lars T. Kyllingstad
4b5f350137 Complete redesign of std.complex 2010-04-20 13:13:11 +00:00
Sean Kelly
747f3cf1e4 Changed Phobos to use the Boost license. Currently, all public domain modules and all licensed modules by Walter, Andrei, Bartosz, and Don have been changed to use this license (excepting std.c, for the moment). Ideally, all Phobos modules will eventually be distributed under this license, which means obtaining permission from a few more authors, deleting, or rewriting some modules.
Removed std.openrj.
2009-09-16 18:19:51 +00:00
Andrei Alexandrescu
e4e66b0d88 commented failing unittest 2009-04-06 20:39:35 +00:00
Andrei Alexandrescu
7d5b1ed849 added complex and iterator modules 2008-02-19 07:02:13 +00:00