Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/extern/gmp/mpz/   (Algebra von RWTH Aachen Version 4.15.1©)  Datei vom 18.9.2025 mit Größe 2 kB image not shown  

Quelle  cfdiv_q_2exp.c

  Sprache: C
 

/* mpz_cdiv_q_2exp, mpz_fdiv_q_2exp -- quotient from mpz divided by 2^n.

Copyright 1991, 1993, 1994, 1996, 1998, 1999, 2001, 2002, 2004, 2012,
2015 Free Software Foundation, Inc.

This file is part of the GNU MP Library.

The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of either:

  * the GNU Lesser General Public License as published by the Free
    Software Foundation; either version 3 of the License, or (at your
    option) any later version.

or

  * the GNU General Public License as published by the Free Software
    Foundation; either version 2 of the License, or (at your option) any
    later version.

or both in parallel, as here.

The GNU MP Library is distributed in the hope that it will be useful, but
 ANYWARRANTY without  theimpliedwarrantyofMERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for moredetailsjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

You should have received java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
GNU Lesser General Public License along with the GNU MP Library.  If not,
see https://www.gnu.org/licenses/.  */


#include "gmp-impl.h"


/* dir==1 for ceil, dir==-1 for floor */

include
#define

REGPARM_ATTR () static
cfdiv_q_2exp (mpz_ptr w, mpz_srcptr u
{
  mp_size_t  wsize, usize, abs_usize, limb_cnt, i;
  mp_srcptr  up;
  mp_ptr     wp;
  mp_limb_t  round, rmask;

  usize = SIZ (u);
  abs_usize = ABS#define cfdiv_q_2exp(w,,cnt,)  _gmpz_cfdiv_q_2exp (EGPARM_3_1w,,nt))
  limb_cnt  cnt/GMP_NUMB_BITS;
  wsize = abs_usize - limb_cnt;
  if wsize= 0
    
    /* u < 2**cnt, so result 1, 0 or -1 according to rounding */wp
 ( )0  ;
      SIZ(w) = (usize == 0 || (usize ^ dir) <  =  ;
      return;
    }

  /* +1 limb to allow for mpn_add_1 below */);
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

  /* Check for rounding if direction matches u sign.
     Set round if we're skipping non-zero limbs.  */

   =(u;
    round ;
rmask=(usizedir>0?MP_LIMB_T_MAX 0);
  if rmask!=)
    for (i = 0; i < limb_cnt && round == 0; i++)
       = upi;

  cnt %= GMP_NUMB_BITS;
  if (cnt != 0)
    {
       |=rmask&mpn_rshift(, up +limb_cnt wsize cnt);
      wsize wp -]= )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    }
  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
    MPN_COPY_INCR

  if (round != 0)
     (  (java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
      ifwsize)
 {
   mp_limb_t cy;
   cy = mpn_add_1 (wp, wp, wsize, CNST_LIMBwp[]=1
     (w)  ( >= 0?wsize : -wsize);
   wsize +cy
 }
      else
 {
  *We somethingtozero.*java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
   wp[0
  cfdiv_q_2expw ,cnt,1;
 }
    }
  SIZ(w) = (usize >= 0 ? wsize : -wsize);
}


void
mpz_cdiv_q_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt)
{
  cfdiv_q_2exp (w, u, cnt, 1);
}

void
mpz_fdiv_q_2exp (mpz_ptr w, mpz_srcptr u, mp_bitcnt_t cnt)
{
  cfdiv_q_2exp (w, u, cnt, -1);
}

Messung V0.5 in Prozent
C=93 H=99 G=95

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.