Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complex +-0. #4748

Closed
vicuna opened this issue Mar 18, 2009 · 1 comment
Closed

Complex +-0. #4748

vicuna opened this issue Mar 18, 2009 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Mar 18, 2009

Original bug ID: 4748
Reporter: @Chris00
Status: resolved (set by @xavierleroy on 2013-07-19T09:40:54Z)
Resolution: suspended
Priority: normal
Severity: minor
Version: 3.11.0
Category: standard library
Related to: #8267
Monitored by: @Chris00

Bug description

This is related to bug #1817 albeit not fitting the description, thus I open a new issue.

Complex.mul Complex.one {Complex.re=(-1.); Complex.im = 0.0};;

  • : Complex.t = {Complex.re = -1.; Complex.im = 0.}

Complex.div Complex.one {Complex.re=(-1.); Complex.im = 0.0};;

  • : Complex.t = {Complex.re = -1.; Complex.im = -0.}

(note the sign of the imaginary part). I believe the second is correct while the first one should return {Complex.re = -1.; Complex.im = -0.}.

@vicuna
Copy link
Author

vicuna commented Jul 19, 2013

Comment author: @xavierleroy

I welcome pointers to a good tutorial on complex arithmetic using IEEE754 floats.

I can understand why you'd expect im = -0.0 in the first example, yet the "_Cmultd" reference implementation of complex multiply in ISO C99, annex G, gives im = +0.0...

Suspending this PR until we have solid background on complex IEEE754 arithmetic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant