12-09-2013 09:27 AM - edited 12-09-2013 09:27 AM
Dear users,
could anybody explain me, why the coercion dots in the following examples do not display/appear consistently, please?
In the example there is always an operation on a CDB (first item) and DBL (second item). The operations are multiplication, division and compound arithmetic (multiply). The coercion dots do not appear for the scalar multiplication and division. But they appear for operations on arrays. The compound arithmetic (multiply) is there to show that the coercion dots could be also displayed for scalar/scalar operation. I repeat that the inconsistency is in missing coercion dots for scalar/scalar operation. This inconsistency do not appear for "Add" and "Subtract" primitive operations.
Thank you for listening!
12-09-2013 09:39 AM - edited 12-09-2013 09:41 AM
While i concur that the compound arithmetics indicates an inconsistency, i have to point out that multiplication/divison of a complex number with a real number is only scaling the complex number.
As the complex number C = (a + b i) can be considered as a vector, multiplication simply makes the vector longer, shorter for devision (for real number > 1! Otherwise, they swap place, from a "logical" point of view.....).
So the result is C * R = a*R + b*R i.
So, essentially, R does not need to cast its type to complex before performing the computation....
Norbert
12-09-2013 10:02 AM - edited 12-09-2013 10:03 AM
Dear Norbert_B,
thank you for your reply.
I do not understand, how a single value CDB can be seen as an array. But I understand that in all of the case the coercion dot makes a CDB value out of the DBL (it converts to a higher type) and no information is lost. I.e., the results in the separate comments (the triplets of results) are equal among each other.
I share the same opinion with you, that the coercion dot can be disregarded (not displayed) in all of the case above and the results is going to be the mathematically same. But that would also ignore the function of the coercion dot -- that is, displaying that a conversion to different type is happening. And that is, what the scalar/scalar operation shows exactly - the missing coercion dot.
Cheers,
12-09-2013 10:08 AM
@ghighuphu wrote:
[...] how a single value CDB can be seen as an array. [...]
A complex number is no array. It does, however, provide to "fields": Real and imaginary unit. Using these two elements, you can display a complex number as a vector in a two dimensional field where x-axis displays the real number, the y-axis the imaginary unit. Refer to wikipedia for a good display and explanation on complex numbers. As both fields are already double with CDB, the double number doesnt need to cast for multiplication and division.
Norbert