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

Implementation of complex numbers with real floating precision #286

Merged
merged 5 commits into from
Sep 2, 2022

Conversation

jgalan
Copy link
Member

@jgalan jgalan commented Aug 31, 2022

jgalan Large: 340

This is a new class that will allow to work with complex numbers using real precision thanks to the implementation of MPFR library types. The first intention is to be used for the definition of the axion field and propagation calculations.

root [0] TRestComplex::SetPrecision(30)
root [1] TRestComplex a
(TRestComplex &) (1,0i)
root [2] TRestComplex b(1.e-15)
(TRestComplex &) (1e-15,0i)
root [3] TRestComplex c(0,1)
(TRestComplex &) (0,1i)
root [4] TRestComplex d(0,1.e-25)
(TRestComplex &) (0,1e-25i)
root [5] a + b + c + d
(TRestComplex) (1.000000000000001,1.0000000000000000000000001i)
root [6] TRestComplex e = (a+b)/(c+d)
(TRestComplex &) (0,-1.0000000000000009999999999i)

@jgalan jgalan requested review from lobis, juanangp, jovoy, Vindaar and a team September 1, 2022 07:48
@jgalan jgalan requested a review from a team September 2, 2022 09:34
@jgalan
Copy link
Member Author

jgalan commented Sep 2, 2022

Approuve plz

@jgalan jgalan merged commit 0d7335c into master Sep 2, 2022
@jgalan jgalan deleted the jgalan_complex branch September 2, 2022 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants