summaryrefslogtreecommitdiff
path: root/src/mp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mp.c')
-rw-r--r--src/mp.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mp.c b/src/mp.c
index 0e46b35..0037135 100644
--- a/src/mp.c
+++ b/src/mp.c
@@ -13,8 +13,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
*/
#include <stdlib.h>
@@ -212,8 +212,8 @@ mp_imaginary_component(const MPNumber *x, MPNumber *z)
z->sign = x->im_sign;
z->exponent = x->im_exponent;
memcpy(z->fraction, x->im_fraction, sizeof(int) * MP_SIZE);
-
- /* Clear (old) imaginary component */
+
+ /* Clear (old) imaginary component */
z->im_sign = 0;
z->im_exponent = 0;
memset(z->im_fraction, 0, sizeof(int) * MP_SIZE);
@@ -235,7 +235,7 @@ mp_add_real(const MPNumber *x, int y_sign, const MPNumber *y, MPNumber *z)
z->sign = y_sign;
return;
}
- /* x + 0 = x */
+ /* x + 0 = x */
else if (mp_is_zero(y)) {
mp_set_from_mp(x, z);
return;
@@ -450,7 +450,7 @@ mp_sgn(const MPNumber *x, MPNumber *z)
else if (mp_is_negative(x))
mp_set_from_integer(-1, z);
else
- mp_set_from_integer(1, z);
+ mp_set_from_integer(1, z);
}
void
@@ -829,7 +829,7 @@ bool
mp_is_integer(const MPNumber *x)
{
MPNumber t1, t2, t3;
-
+
if (mp_is_complex(x))
return false;
@@ -1303,7 +1303,7 @@ void
mp_logarithm(int64_t n, const MPNumber *x, MPNumber *z)
{
MPNumber t1, t2;
-
+
/* log(0) undefined */
if (mp_is_zero(x)) {
/* Translators: Error displayed when attempting to take logarithm of zero */
@@ -1333,7 +1333,7 @@ mp_multiply_real(const MPNumber *x, const MPNumber *y, MPNumber *z)
int c, i, xi;
MPNumber r;
- /* x*0 = 0*y = 0 */
+ /* x*0 = 0*y = 0 */
if (x->sign == 0 || y->sign == 0) {
mp_set_from_integer(0, z);
return;
@@ -1418,7 +1418,7 @@ mp_multiply_real(const MPNumber *x, const MPNumber *y, MPNumber *z)
/* Clear complex part */
z->im_sign = 0;
z->im_exponent = 0;
- memset(z->im_fraction, 0, sizeof(int) * MP_SIZE);
+ memset(z->im_fraction, 0, sizeof(int) * MP_SIZE);
/* NORMALIZE AND ROUND RESULT */
// FIXME: Use stack variable because of mp_normalize brokeness
@@ -1445,11 +1445,11 @@ mp_multiply(const MPNumber *x, const MPNumber *y, MPNumber *z)
mp_imaginary_component(x, &im_x);
mp_real_component(y, &real_y);
mp_imaginary_component(y, &im_y);
-
+
mp_multiply_real(&real_x, &real_y, &t1);
mp_multiply_real(&im_x, &im_y, &t2);
mp_subtract(&t1, &t2, &real_z);
-
+
mp_multiply_real(&real_x, &im_y, &t1);
mp_multiply_real(&im_x, &real_y, &t2);
mp_add(&t1, &t2, &im_z);
@@ -1574,7 +1574,7 @@ mp_multiply_integer_real(const MPNumber *x, int64_t y, MPNumber *z)
z->im_sign = 0;
z->im_exponent = 0;
- memset(z->im_fraction, 0, sizeof(int) * MP_SIZE);
+ memset(z->im_fraction, 0, sizeof(int) * MP_SIZE);
mp_normalize(z);
}
@@ -1746,7 +1746,7 @@ mp_reciprocal_real(const MPNumber *x, MPNumber *z)
void
mp_reciprocal(const MPNumber *x, MPNumber *z)
-{
+{
if (mp_is_complex(x)) {
MPNumber t1, t2;
MPNumber real_x, im_x;
@@ -2003,7 +2003,7 @@ mp_xpowy_integer(const MPNumber *x, int64_t n, MPNumber *z)
mp_set_from_integer(0, z);
return;
}
-
+
/* x^1 = x */
if (n == 1) {
mp_set_from_mp(x, z);