gnome-calculator:wip/mpc

Last commit made on 2016-01-22
Get this branch:
git clone -b wip/mpc https://git.launchpad.net/gnome-calculator

Branch merges

Branch information

Name:
wip/mpc
Repository:
lp:gnome-calculator

Recent commits

c9fc679... by Phillip Wood

Test complex arithmetic

a599408... by Phillip Wood

Add test for equals

c74608c... by Phillip Wood

Change complex-enabled depending on the mode

Disable complex numbers in basic, programming and financial modes. This
needs more work to clear the imaginary part of the last answer.

9e886a6... by Phillip Wood

Make complex numbers optional in number.vala

This adds a global flag to disable complex results, so that in future we
can disable complex numbers in modes where they don't make sense.

3c64064... by Phillip Wood

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

TODO:
* Fix possible integer overflows when converting for int64 to
long (these are inherited from the previous implementation)
* Add a class property to make complex numbers optional - at the moment
the tests that prevent arguments that would product complex results from
functions like cosh are still in place so as not to lose the
translations.
* Add tests for complex numbers to test-number.vala - at the moment
arg() is the only function tested with complex inputs.
* Improve the behaviour of root and power with fraction real powers so
that the simplest root (i.e. real or imaginary rather than complex) is
returned for things like ∛i which should return -i but currently
returns ½√3+½i

abaeccd... by Alberto Ruiz

Prepare for 3.19.4

a387af1... by Alberto Ruiz

Remove unused -D defines from Makefile.am and configure.vapi for both src/ and lib/

9bb6936... by Alberto Ruiz

Migrate HistoryEntry to use a GtkBuilder template

fc8d431... by Alberto Ruiz

Remove the need to pass the MathDisplay instance to MathHistory and HistoryEntryView

b87b4f5... by Alberto Ruiz

Migrate HistoryView to use GtkBuilder templates