April 16, 2012 Re: Why is complex being deprecated again? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars T. Kyllingstad | On 16/04/2012 12:42, Lars T. Kyllingstad wrote: <snip> >> Do you feel the SETI Institute should have given up years ago? > > I don't really see the similarity between SETI and Phobos. They've been working for decades in the hope of finding aliens. In the same way, imaginary types have been put into D in the hope that they would be useful. To leap to the conclusion that they aren't useful, just because they haven't been put to any real use _yet_, would be like SETI leaping to the conclusion that aliens don't exist and therefore abandoning the project. <snip> >> This doesn't cover the case of multiplying a complex number by an imaginary number. In >> the absence of imaginary types, one would have to use complex(-z.im * k, z.re * k), just >> because z * complex(0, k) isn't guaranteed to produce the correct result. >> Seems a bit silly. Or have you another suggestion for dealing with this? > > Yes: Define Complex!T so it produces the desired result in each case. <snip> You mean define complex multiplication and division with a special case so that, when ±0 occurs as the real part of a number, it just pretends there's no real part at all? I can see this slowing down almost any program that does complex arithmetic.... Stewart. |
April 17, 2012 Re: Why is complex being deprecated again? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mehrdad | On 16.04.2012 05:22, Mehrdad wrote:
> So we're removing it to reduce the number of keywords? ...Why?
> Is the keyword-ness of "cdouble" and "ifloat", etc. causing problems for
> people?
Not problems, but serious eye sores: Personally, I am really happy that "ireal" and "creal" are going to drop out of the language specs. Now D finally has the chance of being taken seriously by mathematicians...
(Anyone, who does not get it: imagine a language that calls floating point values "fint" because they are "fractional integers". The same language would probably also have the keywords "cvar" for "constant variable" and "ntrue" for "not true"... :-) )
|
April 17, 2012 Re: Why is complex being deprecated again? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Norbert Nemec | On Tuesday, 17 April 2012 at 18:46:13 UTC, Norbert Nemec wrote:
> On 16.04.2012 05:22, Mehrdad wrote:
>> So we're removing it to reduce the number of keywords? ...Why?
>> Is the keyword-ness of "cdouble" and "ifloat", etc. causing problems for
>> people?
>
> Not problems, but serious eye sores: Personally, I am really happy that "ireal" and "creal" are going to drop out of the language specs. Now D finally has the chance of being taken seriously by mathematicians...
>
> (Anyone, who does not get it: imagine a language that calls floating point values "fint" because they are "fractional integers". The same language would probably also have the keywords "cvar" for "constant variable" and "ntrue" for "not true"... :-) )
Hear, hear! These names have always made me me cringe. (Similar, though not nearly as annoying, is the use of "enum" to declare manifest constants.)
However, I suspect that when the builtins get removed, aliases will be introduced in their place in std.complex.
-Lars
|
Copyright © 1999-2021 by the D Language Foundation