Changeset 5ffb9c in git


Ignore:
Timestamp:
Jan 15, 2019, 4:05:20 PM (6 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '3720ae8bfcff4a4649ee98a15552089151d2d59b')
Children:
1a51aabf6defc65c4718f527714740501eccc6a3
Parents:
1aebcf730f56e73ce98bfe26675f0483eade2ad3
Message:
opt: conversion factory->flint
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/FLINTconvert.cc

    r1aebcf7 r5ffb9c  
    150150{
    151151  //ASSERT (isOn (SW_RATIONAL), "expected rational");
    152   fmpz_t tmp1, tmp2;
    153   fmpz_init (tmp1);
    154   fmpz_init (tmp2);
    155152  if (f.isImm ())
    156153  {
    157     fmpz_set_si (tmp1, f.num().intval());
    158     fmpz_set_si (tmp2, f.den().intval());
     154    fmpz_set_si (fmpq_numref (result), f.num().intval());
     155    fmpz_set_si (fmpq_denref (result), f.den().intval());
    159156  }
    160157  else
     
    162159    mpz_t gmp_val;
    163160    gmp_numerator (f, gmp_val);
    164     fmpz_set_mpz (tmp1, gmp_val);
     161    fmpz_set_mpz (fmpq_numref (result), gmp_val);
    165162    mpz_clear (gmp_val);
    166163    gmp_denominator (f, gmp_val);
    167     fmpz_set_mpz (tmp2, gmp_val);
     164    fmpz_set_mpz (fmpq_denref (result), gmp_val);
    168165    mpz_clear (gmp_val);
    169166  }
    170 
    171   fmpz_set (fmpq_numref (result), tmp1);
    172   fmpz_set (fmpq_denref (result), tmp2);
    173   fmpz_clear (tmp1);
    174   fmpz_clear (tmp2);
    175167}
    176168
Note: See TracChangeset for help on using the changeset viewer.