6644N/A--- a/data/org.gnome.calculator.gschema.xml Fri Jan 29 15:39:20 2016
6644N/A+++ b/data/org.gnome.calculator.gschema.xml Fri Jan 29 15:40:20 2016
6644N/A <schema path="/org/gnome/calculator/" id="org.gnome.calculator" gettext-domain="calculator">
6644N/A--- a/src/Makefile.am Fri Jan 29 15:40:46 2016
6644N/A+++ b/src/Makefile.am Fri Jan 29 15:41:34 2016
6644N/A- $(top_builddir)/lib/libcalculator.vapi \
6644N/A- $(top_builddir)/lib/mpfr.vapi
6644N/A+ $(top_builddir)/lib/libcalculator.vapi
6644N/A- $(top_builddir)/lib/libcalculator.vapi \
6644N/A- $(top_builddir)/lib/mpfr.vapi
6644N/A+ $(top_builddir)/lib/libcalculator.vapi
6644N/A $(top_builddir)/lib/libcalculator.la
6644N/A--- a/lib/Makefile.am Fri Jan 29 15:42:13 2016
6644N/A+++ b/lib/Makefile.am Fri Jan 29 15:42:24 2016
6644N/A--- a/lib/equation-parser.vala Fri Jan 29 15:47:35 2016
6644N/A+++ b/lib/equation-parser.vala Fri Jan 29 16:00:51 2016
6644N/A var r = right.solve ();
6644N/A- if (Number.error != null)
6644N/A- parser.set_error (ErrorCode.MP, Number.error, tmpleft.token.start_index, tmpright.token.end_index);
6644N/A- Number.error = null;
6644N/A var r = right.solve ();
6644N/A- if (Number.error != null)
6644N/A- parser.set_error (ErrorCode.MP, Number.error, tmpleft.token.start_index, tmpright.token.end_index);
6644N/A- Number.error = null;
6644N/A value = value.multiply (t);
6644N/A- if (Number.error != null)
6644N/A- parser.set_error (ErrorCode.MP, Number.error, tmpleft.token.start_index, tmpright.token.end_index);
6644N/A- Number.error = null;
6644N/A tmp = tmp.xpowy_integer (pow);
6644N/A- if (Number.error != null)
6644N/A- Number.error = null;
6644N/A- if (Number.error != null)
6644N/A- parser.set_error (ErrorCode.MP, Number.error, tmpleft.token.start_index, tmpright.token.end_index);
6644N/A- Number.error = null;
6644N/A var mod = right.solve ();
6644N/A- var z = base_value.modular_exponentiation (exponent, mod);
6644N/A+ return base_value.modular_exponentiation (exponent, mod);
6644N/A- if (Number.error != null)
6644N/A- parser.set_error (ErrorCode.MP, Number.error, tmpleft.token.start_index, tmpright.token.end_index);
6644N/A- Number.error = null;
6644N/A var r = right.solve ();
6644N/A- if (Number.error != null)
6644N/A- parser.set_error (ErrorCode.MP, Number.error, tmpleft.token.start_index, tmpright.token.end_index);
6644N/A- Number.error = null;
6644N/A- var z = val.xpowy_integer (pow);
6644N/A+ return val.xpowy_integer (pow);
6644N/A- if (Number.error != null)
6644N/A- parser.set_error (ErrorCode.MP, Number.error, tmpleft.token.start_index, tmpright.token.end_index);
6644N/A- Number.error = null;
6644N/A representation_base = this.representation_base;
6644N/A- error_code = this.error;
6644N/A- error_token = this.error_token;
6644N/A- error_start = this.error_token_start;
6644N/A- error_end = this.error_token_end;
6644N/A+ error_code = ErrorCode.NONE;
6644N/A--- a/lib/equation.vala Fri Jan 29 16:01:11 2016
6644N/A+++ b/lib/equation.vala Fri Jan 29 16:02:09 2016
6644N/A public new Number? parse (out uint representation_base = null, out ErrorCode error_code = null, out string? error_token = null, out uint? error_start = null, out uint? error_end = null)
6644N/A- Number.error = null;
6644N/A var z = parser.parse (out representation_base, out error_code, out error_token, out error_start, out error_end);
6644N/A if (error_code != ErrorCode.NONE)
6644N/A- if (Number.error != null)
6644N/A error_code = ErrorCode.MP;
6644N/A--- a/src/gnome-calculator.vala Fri Jan 29 16:05:17 2016
6644N/A+++ b/src/gnome-calculator.vala Fri Jan 29 16:06:27 2016
6644N/A var target_currency = settings.get_string ("target-currency");
6644N/A var source_units = settings.get_string ("source-units");
6644N/A var target_units = settings.get_string ("target-units");
6644N/A- var precision = settings.get_int ("precision");
6644N/A equation.accuracy = accuracy;
6644N/A equation.target_currency = target_currency;
6644N/A equation.source_units = source_units;
6644N/A equation.target_units = target_units;
6644N/A- Number.precision = precision;
6644N/A else if (error == ErrorCode.MP)
6644N/A+ stderr.printf ("Error: %s\n", mp_get_error());
6644N/A return Posix.EXIT_FAILURE;
6644N/A--- a/src/gcalccmd.vala Fri Jan 29 16:03:42 2016
6644N/A+++ b/src/gcalccmd.vala Fri Jan 29 16:04:56 2016
6644N/A result_serializer.set_representation_base (representation_base);
6644N/A- var str = result_serializer.to_string (z);
6644N/A- if (result_serializer.error != null)
6644N/A- result_serializer.error = null;
6644N/A- stdout.printf ("%s\n", str);
6644N/A else if (ret == ErrorCode.MP)
6644N/A+ stderr.printf ("Error %s\n", mp_get_error());
6644N/A stderr.printf ("Error %d\n", ret);
6644N/A--- a/lib/math-equation.vala Fri Jan 29 16:33:36 2016
6644N/A+++ b/lib/math-equation.vala Fri Jan 29 16:39:56 2016
6644N/A- if (serializer.error != null)
6644N/A- status = serializer.error;
6644N/A- serializer.error = null;
6644N/A case ErrorCode.MP:
6644N/A- if (Number.error != null) // LEGACY, should never be run
6644N/A+ solvedata.error = mp_get_error ();
6644N/A- solvedata.error = _("%s").printf (error_token);
6644N/A+ solvedata.error = _("Malformed expression at token '%s'").printf(error_token);
6644N/A solvedata.error_start = error_start;
6644N/A solvedata.error_end = error_end;
6644N/A end.forward_chars (length);
6644N/A- int real_end = display.index_of_nth_char (error_token_end);
6644N/A- int real_start = display.index_of_nth_char (error_token_start);
6644N/A- /* checks if there are more opening/closing parenthesis than closing/opening parenthesis */
6644N/A- for (int i = real_start; display.get_next_char (ref i, out c) && i <= real_end;)
6644N/A- if (c.to_string () == "(") count++;
6644N/A- if (c.to_string () == ")") count--;
6644N/A- for (int i = real_end; display.get_next_char (ref i, out c) && count > 0;)
6644N/A- if (c.to_string () == ")")
6644N/A- for (int i = real_start; display.get_prev_char (ref i, out c) && count < 0;)
6644N/A- if (c.to_string () == "(")
6644N/A- real_end = display.index_of_nth_char (error_token_end);
6644N/A- real_start = display.index_of_nth_char (error_token_start);
6644N/A- /* if there are opening parenthesis directly before aswell as closing parenthesis directly after the offsets, include those aswell */
6644N/A- while (display.get_next_char (ref real_end, out d) && display.get_prev_char (ref real_start, out c))
6644N/A--- a/src/math-preferences.vala Fri Jan 29 16:40:37 2016
6644N/A+++ b/src/math-preferences.vala Fri Jan 29 16:43:30 2016
6644N/A var tokens = string.split ("%d", 2);
6644N/A- var decimal_places_adjustment = new Gtk.Adjustment (0.0, 0.0, 100.0, 1.0, 1.0, 0.0);
6644N/A+ var decimal_places_adjustment = new Gtk.Adjustment (0.0, 0.0, 9.0, 1.0, 1.0, 0.0);
6644N/A decimal_places_spin = new Gtk.SpinButton (decimal_places_adjustment, 0.0, 0);
6644N/A if (tokens.length > 0)
6644N/A--- a/lib/serializer.vala Mon Feb 1 10:45:23 2016
6644N/A+++ b/lib/serializer.vala Mon Feb 1 10:46:37 2016
6644N/A var d = t3.to_integer ();
6644N/A- string.prepend_c (digits[d]);
6644N/A- string.prepend_c ('?');
6644N/A- string.assign ("0");
6644N/A+ string.prepend_c (d < 16 ? digits[d] : '?');
6644N/A--- a/tests/test-number.vala Mon Feb 1 10:48:08 2016
6644N/A+++ b/tests/test-number.vala Mon Feb 1 10:49:35 2016
6644N/A+ var z = new Number.float (a);
6644N/A+ if (z.to_float () != a)
6644N/A--- a/tests/test-equation.c Mon Feb 1 12:22:33 2016
6644N/A+++ b/tests/test-equation.c Mon Feb 1 12:22:47 2016
6644N/A _tmp3_ = g_strdup_printf ("ErrorCode.MP(\"%s\")", _tmp2_);
6644N/A--- a/lib/number.vala Fri Jan 29 16:44:36 2016
6644N/A+++ b/lib/number.vala Mon Feb 1 12:02:40 2016
6644N/A public Number.integer (int64 value)
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var tmp2 = MPFloat.init2 ((Precision) precision);
6644N/A public Number.unsigned_integer (uint64 x)
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var tmp2 = MPFloat.init2 ((Precision) precision);
6644N/A public Number.fraction (int64 numerator, int64 denominator)
6644N/A Number.integer (numerator);
6644N/A+ re_exponent = z.re_exponent;
6644N/A+ im_exponent = z.im_exponent;
6644N/A+ for (var i = 0; i < z.re_fraction.length; i++)
6644N/A+ re_fraction[i] = z.re_fraction[i];
6644N/A+ im_fraction[i] = z.im_fraction[i];
6644N/A- public Number.mpfloat (MPFloat value)
6644N/A+ public Number.float (float value)
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A+ var z = new Number.integer (0);
6644N/A+ z.re_exponent = 0;
6644N/A+ z.re_fraction[i] = (int) rj;
6644N/A+ rj -= z.re_fraction[i];
6644N/A+ z = z.divide_integer (tp);
6644N/A+ z = z.multiply_integer (tp);
6644N/A+ re_exponent = z.re_exponent;
6644N/A+ im_exponent = z.im_exponent;
6644N/A+ for (var i = 0; i < z.re_fraction.length; i++)
6644N/A+ re_fraction[i] = z.re_fraction[i];
6644N/A+ im_fraction[i] = z.im_fraction[i];
6644N/A public Number.double (double value)
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var tmp2 = MPFloat.init2 ((Precision) precision);
6644N/A+ var z = new Number.integer (0);
6644N/A+ z.re_exponent = 0;
6644N/A+ z.re_fraction[i] = (int) dj;
6644N/A+ dj -= (double) z.re_fraction[i];
6644N/A+ z = z.divide_integer (tp);
6644N/A+ z = z.multiply_integer (tp);
6644N/A+ re_exponent = z.re_exponent;
6644N/A+ im_exponent = z.im_exponent;
6644N/A+ for (var i = 0; i < z.re_fraction.length; i++)
6644N/A+ re_fraction[i] = z.re_fraction[i];
6644N/A+ im_fraction[i] = z.im_fraction[i];
6644N/A public Number.complex (Number x, Number y)
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var tmp2 = MPFloat.init2 ((Precision) precision);
6644N/A+ re_exponent = x.re_exponent;
6644N/A+ for (var i = 0; i < im_fraction.length; i++)
6644N/A+ re_fraction[i] = x.re_fraction[i];
6644N/A+ im_exponent = y.re_exponent;
6644N/A+ for (var i = 0; i < im_fraction.length; i++)
6644N/A+ im_fraction[i] = y.re_fraction[i];
6644N/A public Number.eulers ()
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var tmp2 = MPFloat.init2 ((Precision) precision);
6644N/A- var tmp3 = MPFloat.init2 ((Precision) precision);
6644N/A+ var z = new Number.integer (1).epowy ();
6644N/A+ re_exponent = z.re_exponent;
6644N/A+ im_exponent = z.im_exponent;
6644N/A+ for (var i = 0; i < z.re_fraction.length; i++)
6644N/A+ re_fraction[i] = z.re_fraction[i];
6644N/A+ im_fraction[i] = z.im_fraction[i];
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var tmp2 = MPFloat.init2 ((Precision) precision);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var tmp2 = MPFloat.init2 ((Precision) precision);
6644N/A- re_num.clear ();
6644N/A- im_num.clear ();
6644N/A- return re_num.sgn () < 0;
6644N/A+ var t3 = new Number.integer (10000);
6644N/A- return re_num.is_integer () != 0;
6644N/A- return re_num.sgn () >= 0 && is_integer ();
6644N/A- return re_num.sgn () > 0 && is_integer ();
6644N/A- return !im_num.is_zero ();
6644N/A+ if (re_exponent != y.re_exponent)
6644N/A+ if (re_exponent > y.re_exponent)
6644N/A+ if (re_fraction[i] == y.re_fraction[i])
6644N/A+ if (re_fraction[i] > y.re_fraction[i])
6644N/A+ return new Number.integer (0);
6644N/A+ return new Number.integer (-1);
6644N/A+ return new Number.integer (1);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A x_real = x_real.multiply (x_real);
6644N/A x_im = x_im.multiply (x_im);
6644N/A var z = x_real.add (x_im);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A return new Number.integer (0);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- tmp2.clear ();
6644N/A- tmp = MPFloat.init2 ((Precision) precision);
6644N/A+ z.im_exponent = 0;
6644N/A+ for (var i = 0; i < z.im_fraction.length; i++)
6644N/A+ z.im_fraction[i] = 0;
6644N/A- tmp = MPFloat.init2 ((Precision) precision);
6644N/A+ z.re_exponent = im_exponent;
6644N/A+ for (var i = 0; i < z.im_fraction.length; i++)
6644N/A+ z.re_fraction[i] = im_fraction[i];
6644N/A+ z.im_exponent = 0;
6644N/A+ for (var i = 0; i < z.im_fraction.length; i++)
6644N/A+ z.im_fraction[i] = 0;
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ for (var i = z.re_exponent; i < SIZE; i++)
6644N/A+ z.re_fraction[i] = 0;
6644N/A+ z.im_exponent = 0;
6644N/A+ for (var i = 0; i < z.im_fraction.length; i++)
6644N/A+ z.im_fraction[i] = 0;
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ return new Number.integer (0);
6644N/A+ var z = new Number.integer (0);
6644N/A+ z.re_exponent = re_exponent - shift;
6644N/A+ z.re_fraction[i] = 0;
6644N/A+ z.re_fraction[i] = re_fraction[i + shift];
6644N/A+ if (z.re_fraction[0] == 0)
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ return new Number.integer (-1);
6644N/A+ return new Number.integer (0);
6644N/A+ for (var i = z.re_exponent; i < SIZE; i++)
6644N/A+ if (z.re_fraction[i] != 0)
6644N/A+ z.re_fraction[i] = 0;
6644N/A+ z.im_exponent = 0;
6644N/A+ for (var i = 0; i < z.im_fraction.length; i++)
6644N/A+ z.im_fraction[i] = 0;
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ f = f.multiply_integer (2);
6644N/A- if (is_zero () && y.is_negative ())
6644N/A+ if (y.is_integer ())
6644N/A+ return xpowy_integer (y.to_integer ());
6644N/A- return new Number.integer (0);
6644N/A- return new Number.integer (0);
6644N/A- if (!y.is_integer ())
6644N/A var reciprocal = y.reciprocal ();
6644N/A if (reciprocal.is_integer ())
6644N/A return root (reciprocal.to_integer ());
6644N/A- if (y.is_negative ())
6644N/A- t2 = y.invert_sign ();
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A- tmp2.clear ();
6644N/A- tmp = MPFloat.init2 ((Precision) precision);
6644N/A return new Number.integer (0);
6644N/A return new Number.integer (0);
6644N/A+ return new Number.integer (1);
6644N/A+ return new Number.integer (0);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A- tmp2.clear ();
6644N/A- tmp = MPFloat.init2 ((Precision) precision);
6644N/A+ var z = new Number.integer (1);
6644N/A- return new Number.integer (0);
6644N/A- if (y.is_negative ())
6644N/A- return new Number.integer (0);
6644N/A+ z = z.multiply (t);
6644N/A+ t = t.multiply (t);
6644N/A- return new Number.integer (1);
6644N/A- return y.multiply (ln ()).epowy ();
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ return new Number.integer (0);
6644N/A return new Number.integer (0);
6644N/A return new Number.integer (0);
6644N/A /* Translators: Error displayed when attempted take the factorial of a negative or complex number */
6644N/A return new Number.integer (0);
6644N/A- var tmp = add (new Number.integer (1));
6644N/A- var tmp2 = MPFloat.init2 ((Precision) precision);
6644N/A+ var fact = Math.tgamma(val+1);
6644N/A- return new Number.mpfloat (tmp2);
6644N/A+ return new Number.double(fact);
6644N/A /* Convert to integer - if couldn't be converted then the factorial would be too big anyway */
6644N/A- if (is_complex () || y.is_complex ())
6644N/A- var real_y = y.real_component ();
6644N/A- var im_y = y.imaginary_component ();
6644N/A- real_z = real_x.add_real (real_y);
6644N/A- im_z = im_x.add_real (im_y);
6644N/A- return new Number.complex (real_z, im_z);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A- return add (y.invert_sign ());
6644N/A+ return new Number.integer (0);
6644N/A if (is_complex () || y.is_complex ())
6644N/A- var z = new Number.integer (0);
6644N/A- var z = new Number.integer (0);
6644N/A+ return new Number.complex (re_z, im_z);
6644N/A return new Number.integer (0);
6644N/A- if (is_complex () || y.is_complex ())
6644N/A- var c = y.real_component ();
6644N/A- var d = y.imaginary_component ();
6644N/A+ var t = y.reciprocal ();
6644N/A+ var ie = t.re_exponent;
6644N/A+ t.re_exponent = 0;
6644N/A+ var i = t.re_fraction[0];
6644N/A+ z.re_exponent += ie;
6644N/A- var z_1 = tmp.divide (tmp_2);
6644N/A- var z_2 = tmp.divide (tmp_2);
6644N/A- var z = new Number.complex (z_1, z_2);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A- return divide (new Number.integer (y));
6644N/A+ return new Number.complex (re_z, im_z);
6644N/A if (!is_integer () || !y.is_integer ())
6644N/A /* Translators: Error displayed when attemping to do a modulus division on non-integer numbers */
6644N/A return new Number.integer (0);
6644N/A if (exp.is_negative ())
6644N/A base_value = base_value.reciprocal ();
6644N/A public Number tan (AngleUnit unit = AngleUnit.RADIANS)
6644N/A- var check = x_radians.subtract (new Number.pi ().divide_integer (2)).divide (new Number.pi ());
6644N/A- if (check.is_integer ())
6644N/A+ if (cos_x.is_zero ())
6644N/A- error = _("Tangent is undefined for angles that are multiples of π (180°) from π∕2 (90°)");
6644N/A+ mperr (_("Tangent is undefined for angles that are multiples of π (180°) from π∕2 (90°)"));
6644N/A return new Number.integer (0);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A public Number asin (AngleUnit unit = AngleUnit.RADIANS)
6644N/A return new Number.integer (0);
6644N/A+ var t1 = new Number.integer (1);
6644N/A+ t1 = t1.subtract (this);
6644N/A+ t2 = t1.multiply (t2);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A- return z.from_radians (unit);
6644N/A+ var t2 = new Number.integer (re_sign);
6644N/A+ return z.from_radians (unit);
6644N/A+ return new Number.integer (0);
6644N/A public Number acos (AngleUnit unit = AngleUnit.RADIANS)
6644N/A+ var t1 = new Number.integer (1);
6644N/A+ var n1 = new Number.integer (-1);
6644N/A- return new Number.integer (0);
6644N/A+ z = new Number.integer (0);
6644N/A+ z = pi.divide_integer (2);
6644N/A+ z = new Number.integer (0);
6644N/A+ t2 = t1.subtract (t2);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A return z.from_radians (unit);
6644N/A public Number atan (AngleUnit unit = AngleUnit.RADIANS)
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ return new Number.integer (0);
6644N/A+ if (re_exponent.abs () <= 2)
6644N/A+ while (t2.re_exponent >= 0)
6644N/A+ z = t2.multiply (t2);
6644N/A+ var t1 = t2.multiply (t2);
6644N/A+ if (T + 2 + t2.re_exponent <= 1)
6644N/A+ t2 = t2.multiply (t1).multiply_integer (-i).divide_integer (i + 2);
6644N/A+ if (t2.is_zero ())
6644N/A+ z = z.multiply_integer (q);
6644N/A+ if (re_exponent.abs () <= 2)
6644N/A+ float ry = z.to_float ();
6644N/A return z.from_radians (unit);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ return new Number.integer (0);
6644N/A+ /* If |x| < 1 USE EXP TO AVOID CANCELLATION, otherwise IF TOO LARGE EPOWY GIVES ERROR MESSAGE */
6644N/A+ if (abs_x.re_exponent <= 0)
6644N/A+ var exp_x = abs_x.epowy ();
6644N/A+ z = a.multiply (b);
6644N/A+ var exp_x = abs_x.epowy ();
6644N/A+ z = exp_x.reciprocal ();
6644N/A+ z = exp_x.subtract (z);
6644N/A+ z = z.divide_integer (2);
6644N/A+ return z.multiply_integer (re_sign);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ return new Number.integer (1);
6644N/A+ var z = t.reciprocal ();
6644N/A+ return z.divide_integer (2);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ return new Number.integer (0);
6644N/A+ var z = new Number.double (r__1);
6644N/A+ return new Number.integer (re_sign);
6644N/A+ t = t.multiply_integer (2);
6644N/A+ if (t.re_exponent > 0)
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A return new Number.integer (0);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A return new Number.integer (0);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ var n = add (new Number.integer (1));
6644N/A+ return z.divide_integer (2);
6644N/A is_positive_integer () || !y.is_positive_integer ())
6644N/A if (!is_positive_integer () || !y.is_positive_integer ())
6644N/A if (!is_positive_integer () || !y.is_positive_integer ())
6644N/A return bitwise (new Number.integer (0), (v1, v2) => { return v1 ^ 0xF; }, wordlen);
6644N/A return new Number.integer (0);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var tmp2 = MPFloat.init2 ((Precision) precision);
6644N/A- tmp.@set(re_num, Round.NEAREST);
6644N/A- tmp2.@set(im_num, Round.NEAREST);
6644N/A+ z.re_exponent = re_exponent;
6644N/A+ z.im_exponent = im_exponent;
6644N/A+ for (var i = 0; i < re_fraction.length; i++)
6644N/A+ z.re_fraction[i] = re_fraction[i];
6644N/A+ z.im_fraction[i] = im_fraction[i];
6644N/A+ if (is_complex () || y.is_complex ())
6644N/A+ var real_y = y.real_component ();
6644N/A+ var im_y = y.imaginary_component ();
6644N/A+ return new Number.complex (real_z, im_z);
6644N/A+ return new Number.integer (1);
6644N/A+ var ix = t2.to_integer ();
6644N/A+ t2 = t2.fractional_component ();
6644N/A+ t2.re_sign *= xs;
6644N/A+ var t1 = new Number.integer (xs);
6644N/A+ t2.re_sign = 0;
6644N/A+ t1 = t1.divide_integer (i * xs);
6644N/A+ if (t1.is_zero ())
6644N/A+ t2 = t2.xpowy_integer (ix);
6644N/A+ z = z.multiply (t2);
6644N/A+ var rz = z.to_double ();
6644N/A+ return new Number.integer (1);
6644N/A+ return new Number.integer (0);
6644N/A+ t1 = t1.divide_integer (ic);
6644N/A+ if (t1.is_zero ())
6644N/A+ return new Number.integer (0);
6644N/A+ t2 = t1.multiply (t2);
6644N/A+ t2 = t2.divide_integer (i);
6644N/A+ if (t2.is_zero ())
6644N/A+ z = t1.multiply (z);
6644N/A+ return new Number.integer (0);
6644N/A+ return new Number.integer (0);
6644N/A+ return new Number.integer (1);
6644N/A+ return y.multiply (ln ()).epowy ();
6644N/A+ return new Number.integer (0);
6644N/A+ return new Number.integer (0);
6644N/A+ return new Number.integer (0);
6644N/A+ return new Number.integer (0);
6644N/A+ t1.re_exponent = 0;
6644N/A+ var approximation = Math.exp (((np * ex - re_exponent) * Math.log (BASE) - Math.log (Math.fabs (t1.to_float ()))) / np);
6644N/A+ t1 = new Number.double (approximation);
6644N/A+ t1.re_sign = re_sign;
6644N/A+ t1.re_exponent -= (int) ex;
6644N/A+ t2 = t1.xpowy_integer (np);
6644N/A+ t2 = t1.multiply (t2);
6644N/A+ t2 = t2.divide_integer (np);
6644N/A+ t1 = t1.subtract (t2);
6644N/A+ t1 = t1.xpowy_integer (n - 1);
6644N/A+ z.re_fraction[T - 2] = 0;
6644N/A+ z.re_fraction[T - 1] = 0;
6644N/A+ z.re_fraction[T - 2] = BASE - 1;
6644N/A+ z.re_fraction[T - 1] = BASE;
6644N/A+ return z.multiply_integer (1);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ if (equals (new Number.eulers ()))
6644N/A+ return new Number.integer (1);
6644N/A+ var z = new Number.integer (0);
6644N/A+ var e = t1.re_exponent;
6644N/A+ t1.re_exponent = 0;
6644N/A+ var rx = t1.to_double ();
6644N/A+ t1.re_exponent = e;
6644N/A+ t2 = new Number.double (-rlx);
6644N/A+ z = z.subtract (t2);
6644N/A+ t1 = t1.multiply (t2);
6644N/A+ t1 = t2.multiply (t3);
6644N/A+ z = z.subtract (t3);
6644N/A+ return y.invert_sign ();
6644N/A+ var exp_diff = re_exponent - y.re_exponent;
6644N/A+ var med = exp_diff.abs ();
6644N/A+ int i = re_fraction[j] - y.re_fraction[j];
6644N/A+ return new Number.integer (0);
6644N/A+ var z = new Number.integer (0);
6644N/A+ z.re_exponent = re_exponent;
6644N/A+ small_fraction = y.re_fraction;
6644N/A+ big_fraction = y.re_fraction;
6644N/A+ z.re_fraction[T + i] = 0;
6644N/A+ /* This is probably insufficient overflow detection, but it makes us not crash at least. */
6644N/A+ return new Number.integer (0);
6644N/A+ z.re_fraction[i] = small_fraction[i - med];
6644N/A+ z.re_fraction[i] = c;
6644N/A+ z.re_fraction[i] = c - BASE;
6644N/A+ z.re_fraction[i] = c;
6644N/A+ z.re_fraction[i] = big_fraction[i];
6644N/A+ z.re_fraction[i] = 0;
6644N/A+ z.re_fraction[0] = 1;
6644N/A+ z.re_exponent++;
6644N/A+ z.re_fraction[i] = c - small_fraction[i - med];
6644N/A+ if (z.re_fraction[i] < 0)
6644N/A+ z.re_fraction[i] += BASE;
6644N/A+ z.re_fraction[i] = c;
6644N/A+ z.re_fraction[i] = c + BASE;
6644N/A+ z.re_fraction[i] = c;
6644N/A+ z.re_fraction[i] = big_fraction[i];
6644N/A+ z.re_fraction[i] = c + BASE;
6644N/A+ return new Number.integer (0);
6644N/A+ var z = new Number.integer (0);
6644N/A+ var r = new Number.integer (0);
6644N/A+ return new Number.integer (0);
6644N/A+ int ri = r.re_fraction[j] + c;
6644N/A+ return new Number.integer (0);
6644N/A+ r.re_fraction[j] = ri - BASE * c;
6644N/A+ return new Number.integer (0);
6644N/A+ int ri = r.re_fraction[i] + c;
6644N/A+ return new Number.integer (0);
6644N/A+ r.re_fraction[i] = ri - BASE * c;
6644N/A+ return new Number.integer (0);
6644N/A+ z.im_exponent = 0;
6644N/A+ for (var i = 0; i < z.im_fraction.length; i++)
6644N/A+ z.im_fraction[i] = 0;
6644N/A+ return new Number.integer (0);
6644N/A+ var z = new Number.integer (0);
6644N/A+ z.re_exponent = re_exponent + 4;
6644N/A+ z.re_fraction[i] = (int) (t - BASE * is);
6644N/A+ z.re_fraction[i] = (int) (ri - BASE * c);
6644N/A+ return new Number.integer (0);
6644N/A+ z.re_fraction[i] = (int) (t - BASE * c);
6644N/A+ z.re_fraction[0] = (int) (t - BASE * c);
6644N/A+ z.re_exponent++;
6644N/A+ return new Number.integer (0);
6644N/A+ z.im_exponent = 0;
6644N/A+ for (var i = 0; i < z.im_fraction.length; i++)
6644N/A+ z.im_fraction[i] = 0;
6644N/A return new Number.integer (0);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- z.re_num.clear ();
6644N/A+ t1.re_exponent = 0;
6644N/A+ t1.re_exponent -= re_exponent;
6644N/A+ t2 = t1.multiply (t2);
6644N/A+ t1 = t1.subtract (t2);
6644N/A+ return new Number.integer (0);
6644N/A+ return new Number.integer (0);
6644N/A+ var z = new Number.integer (0);
6644N/A+ z.re_exponent = re_exponent;
6644N/A+ return new Number.integer (0);
6644N/A+ z.re_exponent += (int) (1 - i);
6644N/A+ z.re_fraction[0] = (int) r1;
6644N/A+ z.re_fraction[k] = (int) (c / y);
6644N/A+ c = BASE * (c - y * z.re_fraction[k]);
6644N/A+ return new Number.integer (0);
6644N/A+ z.re_fraction[k] = (int) (c / y);
6644N/A+ c = BASE * (c - y * z.re_fraction[k]);
6644N/A+ return new Number.integer (0);
6644N/A+ z.re_exponent += (int) (1 - i);
6644N/A+ z.re_fraction[k - 1] = (int) (iqj + ir);
6644N/A+ return new Number.integer (0);
6644N/A+ return new Number.integer (0);
6644N/A+ return new Number.integer (0);
6644N/A+ return new Number.integer (1);
6644N/A+ t1 = new Number.integer (1);
6644N/A+ z = new Number.integer (0);
6644N/A+ if (T + t1.re_exponent <= 0)
6644N/A+ t1 = t2.multiply (t1);
6644N/A+ t1 = t1.divide_integer (-i);
6644N/A+ t1 = t1.divide_integer (i + 1);
6644N/A+ t1 = t1.divide_integer (-i * (i + 1));
6644N/A+ } while (t1.re_sign != 0);
6644N/A+ return new Number.integer (0);
6644N/A- var z = new Number.integer (0);
6644N/A+ var xs = x_radians.re_sign;
6644N/A+ x_radians = x_radians.abs ();
6644N/A+ z = x_radians.sin1 (true);
6644N/A+ x_radians = x_radians.divide (z);
6644N/A+ x_radians = x_radians.divide_integer (8);
6644N/A+ x_radians = x_radians.fractional_component ();
6644N/A+ xs = -xs * x_radians.re_sign;
6644N/A+ return new Number.integer (0);
6644N/A+ x_radians.re_sign = 1;
6644N/A+ x_radians = x_radians.multiply_integer (4);
6644N/A+ if (x_radians.re_exponent > 0)
6644N/A+ if (x_radians.is_zero ())
6644N/A+ return new Number.integer (0);
6644N/A+ x_radians.re_sign = 1;
6644N/A+ x_radians = x_radians.multiply_integer (2);
6644N/A+ if (x_radians.re_exponent > 0)
6644N/A+ x_radians = x_radians.multiply (z);
6644N/A+ z = x_radians.sin1 (false);
6644N/A+ x_radians = x_radians.multiply (z);
6644N/A+ z = x_radians.sin1 (true);
6644N/A- var tmp = MPFloat.init2 ((Precision) precision);
6644N/A- var z = new Number.mpfloat (tmp);
6644N/A+ return new Number.integer (1);
6644N/A return new Number.integer (0);
6644N/A var z = new Number.integer (0);
6644N/A while (str.get_next_char (ref index, out c))
6644N/A+// FIXME: Is r.re_fraction large enough? It seems to be in practise but it may be T+4 instead of T
6644N/A+// FIXME: There is some sort of stack corruption/use of unitialised variables here. Some functions are
6644N/A+// using stack variables as x otherwise there are corruption errors. e.g. "Cos (45) - 1/Sqrt (2) = -0"
6644N/A+ for (start_index = 0; start_index < SIZE && x.re_fraction[start_index] == 0; start_index++);
6644N/A+ x.re_exponent = 0;
6644N/A+ x.re_exponent -= start_index;
6644N/A+ x.re_fraction[i] = 0;
6644N/A--- gnome-calculator-3.18.2/configure.ac 2016-08-09 14:02:40.743464258 +0000
6644N/A+++ gnome-calculator-3.18.2/configure.ac 2016-08-09 14:02:52.623794159 +0000