Skip to content
Commit 476df143 authored by Phillip Wood's avatar Phillip Wood Committed by Robert Roth
Browse files

Use MPC for complex numbers

MPC is a library for complex numbers built on top of MPFR. Using it
fixes a number of issues with GNOME Calculators incomplete support for
complex numbers and simplifies the implementation of a number of
functions.

Thanks to Daniel Renninghoff this commit also reworks the MPFR bindings
to use vala's automatic memory management. I've added a default rounding
mode which makes the calling code cleaner.

The use of MPFR.RealRef is not ideal but there doesn't seem to be a
better way to deal with references to structs in vala.

The lvalue_allowed = false annotation is necessary to make MPC.abs() and
MPC.arg() work, otherwise vala stores the result in a copy of the target
variable.

The bindings for MPC and MPFR.RealRef are licensed GPL3+ as MPFR and
MPC are LGPL3 so it doesn't make sense to license them as GPL2+ as the
GPL2 is incompatible with LGPL3

https://bugzilla.gnome.org/show_bug.cgi?id=759439
parent c0888820
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment