set_prc_raw.c
Upload User: qaz666999
Upload Date: 2022-08-06
Package Size: 2570k
Code Size: 1k
Category:

Algorithm

Development Platform:

Unix_Linux

  1. /* mpf_set_prec_raw(x,bits) -- Change the precision of x without changing
  2.    allocation.  For proper operation, the original precision need to be reset
  3.    sooner or later.
  4. Copyright 1996, 2001 Free Software Foundation, Inc.
  5. This file is part of the GNU MP Library.
  6. The GNU MP Library is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU Lesser General Public License as published by
  8. the Free Software Foundation; either version 3 of the License, or (at your
  9. option) any later version.
  10. The GNU MP Library is distributed in the hope that it will be useful, but
  11. WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12. or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
  13. License for more details.
  14. You should have received a copy of the GNU Lesser General Public License
  15. along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.  */
  16. #include "gmp.h"
  17. #include "gmp-impl.h"
  18. void
  19. mpf_set_prec_raw (mpf_ptr x, mp_bitcnt_t prec_in_bits)
  20. {
  21.   x->_mp_prec = __GMPF_BITS_TO_PREC (prec_in_bits);
  22. }