About Complex>>sign

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

About Complex>>sign

Nicolas Cellier
What is the purpose of this message?

It sounds very suspicious to me, because there is nothing like a natural sign definition for complex, like there is no natural full order relation...
Well, there are many possible full order relations, but none respects (a < b & (c < d) ==> ((a+c)<(b+d)))

Or maybe there is a signum function extension for complex, but very different from current implementation, see http://en.wikipedia.org/wiki/Sign_function

--
You received this message because you are subscribed to the Google Groups "SciSmalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: About Complex>>sign

werner kassens-2


On Monday, April 21, 2014 10:45:48 PM UTC+2, Nicolas Cellier wrote:
What is the purpose of this message?
probably just some kind of completeness? otoh it wouldnt be too difficult to write 'real sign' instead of 'sign' if one needs to.
werner

--
You received this message because you are subscribed to the Google Groups "SciSmalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: About Complex>>sign

djuber
Nicolas,

I believe this was added by me because sign was being sent by printing and inspecting methods in DHB Polynomials, so creating a polynomial with complex coefficients caused errors when an inspector was opened or the value was printed. Since the real is printed first, it seemed innocuous to add the 'sign' of the complex as the sign of the real to cue to the print methods to use either a plus or a minus. I agree that this has no valid mathematical meaning. It's never called in arithmetic, but there were places in the DHB code that assumed scalars had a sign method and that this was needed for printOn and similar methods.

Dan

On 4/22/14, 2:05 AM, werner kassens wrote:


On Monday, April 21, 2014 10:45:48 PM UTC+2, Nicolas Cellier wrote:
What is the purpose of this message?
probably just some kind of completeness? otoh it wouldnt be too difficult to write 'real sign' instead of 'sign' if one needs to.
werner
--
You received this message because you are subscribed to the Google Groups "SciSmalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


signature.asc (591 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: About Complex>>sign

Nicolas Cellier


On Tuesday, April 22, 2014 5:15:01 PM UTC+2, Daniel Uber wrote:
Nicolas,

I believe this was added by me because sign was being sent by printing and inspecting methods in DHB Polynomials, so creating a polynomial with complex coefficients caused errors when an inspector was opened or the value was printed. Since the real is printed first, it seemed innocuous to add the 'sign' of the complex as the sign of the real to cue to the print methods to use either a plus or a minus. I agree that this has no valid mathematical meaning. It's never called in arithmetic, but there were places in the DHB code that assumed scalars had a sign method and that this was needed for printOn and similar methods.

Dan


Thanks, that's what I wanted to know.
So DHB requires a polymorphic behaviour of Number and Complex.
The sign implementation does not match that of Mathematica, Haskell, Matlab, ...
If ever we don't want to keep current sign implementation, we have several solutions:
- define a dhbSign extension
- arrange to have a DhbComplexPolynomial with different sign handling
- or more simply rewrite the part using sign

I'll try and have a look when I have time...
There is no urge about that, we can keep sign as is in the interim.

 
On 4/22/14, 2:05 AM, werner kassens wrote:


On Monday, April 21, 2014 10:45:48 PM UTC+2, Nicolas Cellier wrote:
What is the purpose of this message?
probably just some kind of completeness? otoh it wouldnt be too difficult to write 'real sign' instead of 'sign' if one needs to.
werner
--
You received this message because you are subscribed to the Google Groups "SciSmalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ikFo7iJfjRkJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">scismalltalk...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "SciSmalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.