]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libdecnumber: Fix typos in various files
authorDhruv Chawla <dhruvc@nvidia.com>
Thu, 14 May 2026 09:07:11 +0000 (09:07 +0000)
committerDhruv Chawla <dhruvc@nvidia.com>
Sat, 30 May 2026 14:19:36 +0000 (19:49 +0530)
Signed-off-by: Dhruv Chawla <dhruvc@nvidia.com>
libdecnumber/ChangeLog:

* decBasic.c (decCanonical): Fix typos.
(decDivide): Likewise.
(decFiniteMultiply): Likewise.
(decFloatMultiply): Likewise.
(decFloatQuantize): Likewise.
(decToInt32): Likewise.
* decCommon.c (decFinalize): Likewise.
(decFloatFromString): Likewise.
* decContext.c (decContextGetStatus): Likewise.
* decNumber.c (decToString): Likewise.
(decAddOp): Likewise.
(decMalloc): Likewise.
* decNumberLocal.h: Likewise.

libdecnumber/decBasic.c
libdecnumber/decCommon.c
libdecnumber/decContext.c
libdecnumber/decNumber.c
libdecnumber/decNumberLocal.h

index f810eba6cad7dbcf57fd0d32359e837554bec68f..8f257e1056966235e8f999edc2e6950983ae14ab 100644 (file)
@@ -123,7 +123,7 @@ static decFloat * decCanonical(decFloat *result, const decFloat *df) {
   #endif
   } /* block */
 
-  /* Loop to repair a non-canonical coefficent, as needed */
+  /* Loop to repair a non-canonical coefficient, as needed */
   inword=DECWORDS-1;              /* current input word */
   uoff=0;                         /* bit offset of declet */
   encode=DFWORD(result, inword);
@@ -178,7 +178,7 @@ static decFloat * decDivide(decFloat *result, const decFloat *dfl,
                            const decFloat *dfr, decContext *set, uInt op) {
   decFloat quotient;              /* for remainders */
   bcdnum num;                     /* for final conversion */
-  uInt  acc[DIVACCLEN];           /* coefficent in base-billion .. */
+  uInt  acc[DIVACCLEN];           /* coefficient in base-billion .. */
   uInt  div[DIVOPLEN];            /* divisor in base-billion .. */
   uInt  quo[DIVOPLEN+1];          /* quotient in base-billion .. */
   uByte  bcdacc[(DIVOPLEN+1)*9+2]; /* for quotient in BCD, +1, +1 */
@@ -255,7 +255,7 @@ static decFloat * decDivide(decFloat *result, const decFloat *dfl,
     } /* 0/x */
   /* [here, both operands are known to be finite and non-zero] */
 
-  /* extract the operand coefficents into 'units' which are */
+  /* extract the operand coefficients into 'units' which are */
   /* base-billion; the lhs is high-aligned in acc and the msu of both */
   /* acc and div is at the right-hand end of array (offset length-1); */
   /* the quotient can need one more unit than the operands as digits */
@@ -726,7 +726,7 @@ static void decFiniteMultiply(bcdnum *num, uByte *bcdacc,
   #if DECUSE64
   uLong  accl[MULACCLEN];         /* lazy accumulator (base-billion+) */
   uLong  *pl;                     /* work -> lazy accumulator */
-  uInt  acc[MULACCLEN];           /* coefficent in base-billion .. */
+  uInt  acc[MULACCLEN];           /* coefficient in base-billion .. */
   #else
   uInt  acc[MULACCLEN*2];         /* accumulator in base-billion .. */
   #endif
@@ -766,7 +766,7 @@ static void decFiniteMultiply(bcdnum *num, uByte *bcdacc,
   #endif
 
   /* Effect the multiplication */
-  /* The multiplcation proceeds using MFC's lazy-carry resolution */
+  /* The multiplication proceeds using MFC's lazy-carry resolution */
   /* algorithm from decNumber. First, the multiplication is */
   /* effected, allowing accumulation of the partial products (which */
   /* are in base-billion at each column position) into 64 bits */
@@ -2661,7 +2661,7 @@ decFloat * decFloatMultiply(decFloat *result,
                            const decFloat *dfl, const decFloat *dfr,
                            decContext *set) {
   bcdnum num;                     /* for final conversion */
-  uByte  bcdacc[DECPMAX9*18+1];    /* for coefficent in BCD */
+  uByte  bcdacc[DECPMAX9*18+1];    /* for coefficient in BCD */
 
   if (DFISSPECIAL(dfl) || DFISSPECIAL(dfr)) { /* either is special? */
     /* NaNs are handled as usual */
@@ -3072,7 +3072,7 @@ decFloat * decFloatQuantize(decFloat *result,
       } /* inexact rounding */
 
     /* now clear zeros to the left so exactly DECPMAX digits will be */
-    /* available in the coefficent -- the first word to the left was */
+    /* available in the coefficient -- the first word to the left was */
     /* cleared earlier for safe carry; now add any more needed */
     if (drop>4) {
       UBFROMUI(BUFOFF-8, 0);                /* must be at least 5 */
@@ -3091,7 +3091,7 @@ decFloat * decFloatQuantize(decFloat *result,
       ulsd=BUFOFF+DECPMAX-1;
       }
      else { /* padding will fit (but may still be too long) */
-      /* final-word mask depends on endianess */
+      /* final-word mask depends on endianness */
       #if DECLITEND
       static const uInt dmask[]={0, 0x000000ff, 0x0000ffff, 0x00ffffff};
       #else
@@ -3833,7 +3833,7 @@ static uInt decToInt32(const decFloat *df, decContext *set,
     set->status|=DEC_Invalid_operation; /* Invalid or out of range */
     return 0;
     }
-  /* get last twelve digits of the coefficent into hi & ho, base */
+  /* get last twelve digits of the coefficient into hi & ho, base */
   /* 10**9 (see GETCOEFFBILL): */
   sourlo=DFWORD(&result, DECWORDS-1);
   lo=DPD2BIN0[sourlo&0x3ff]
index 3e395cfa6eff9c5037bee2bf911bd1db40da11fb..950bcd805bfd679f3c3382ac3b689c350d19e87a 100644 (file)
@@ -252,7 +252,7 @@ static decFloat * decFinalize(decFloat *df, bcdnum *num,
   #if DECCHECK
   Int clen=ulsd-umsd+1;
   #if QUAD
-    #define COEXTRA 2                       /* extra-long coefficent */
+    #define COEXTRA 2                       /* extra-long coefficient */
   #else
     #define COEXTRA 0
   #endif
@@ -795,7 +795,7 @@ decFloat * decFloatFromString(decFloat *result, const char *string,
   uInt  uiwork;                   /* for macros */
   bcdnum num;                     /* collects data for finishing */
   uInt  error=DEC_Conversion_syntax;   /* assume the worst */
-  uByte  buffer[ROUNDUP(DECSTRING+11, 8)]; /* room for most coefficents, */
+  uByte  buffer[ROUNDUP(DECSTRING+11, 8)]; /* room for most coefficients, */
                                   /* some common rounding, +3, & pad */
   #if DECTRACE
   /* printf("FromString %s ...\n", string); */
index 97b21c96ffaac2f52f9255892b936477c82c677a..bf8e200664ede910ca5e2c404227c68cf8890ba2 100644 (file)
@@ -170,7 +170,7 @@ uInt decContextGetStatus(decContext *context) {
 /*  newstatus is the source for the bits to be restored              */
 /*  mask indicates the bits to be restored (the status bit that       */
 /*    corresponds to each 1 bit in the mask is set to the value of    */
-/*    the correspnding bit in newstatus)                             */
+/*    the corresponding bit in newstatus)                            */
 /*  returns context                                                  */
 /*                                                                   */
 /* No error is possible.                                             */
index 97f825dd9e6c2843ac4f00e7bd9ea3acd54a2ed3..b25f82779fd328df5ff58541335dc8acd7adb354 100644 (file)
@@ -3792,7 +3792,7 @@ static void decToString(const decNumber *dn, char *string, Flag eng) {
 /*                                                                   */
 /* Addition, especially x=x+1, is speed-critical.                    */
 /* The static buffer is larger than might be expected to allow for    */
-/* calls from higher-level funtions (notable exp).                   */
+/* calls from higher-level functions (notable exp).                  */
 /* ------------------------------------------------------------------ */
 static decNumber * decAddOp(decNumber *res, const decNumber *lhs,
                            const decNumber *rhs, decContext *set,
@@ -4206,7 +4206,7 @@ static decNumber * decAddOp(decNumber *res, const decNumber *lhs,
 /* long subtractions.  These are acc and var1 respectively.          */
 /* var1 is a copy of the lhs coefficient, var2 is the rhs coefficient.*/
 /* The static buffers may be larger than might be expected to allow   */
-/* for calls from higher-level funtions (notable exp).               */
+/* for calls from higher-level functions (notable exp).                      */
 /* ------------------------------------------------------------------ */
 static decNumber * decDivideOp(decNumber *res,
                               const decNumber *lhs, const decNumber *rhs,
@@ -5571,7 +5571,7 @@ const uShort LNnn[90]={9016,  8652,  8316,  8008,  7724,  7456,  7208,
 /*    would certainly save at least one if it were made ten times     */
 /*    bigger, too (for truncated fractions 0.100 through 0.999).      */
 /*    However, for most practical evaluations, at least four or five  */
-/*    iterations will be neede -- so this would only speed up by      */
+/*    iterations will be needed -- so this would only speed up by      */
 /*    20-25% and that probably does not justify increasing the table  */
 /*    size.                                                          */
 /*                                                                   */
@@ -8091,7 +8091,7 @@ static void *decMalloc(size_t n) {
   uInt uiwork;                    /* for macros */
 
   alloc=malloc(size);             /* -> allocated storage */
-  if (alloc==NULL) return NULL;    /* out of strorage */
+  if (alloc==NULL) return NULL;    /* out of storage */
   b0=(uByte *)alloc;              /* as bytes */
   decAllocBytes+=n;               /* account for storage */
   UBFROMUI(alloc, n);             /* save n */
index 618d8f703701dc6bd38ea36bdcb919dcd685bd6d..c0f02627d61c9dca0d142ef8f4d3cbf38a1e7a98 100644 (file)
@@ -173,7 +173,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 
   /* ---------------------------------------------------------------- */
-  /* Definitions for arbitary-precision modules (only valid after     */
+  /* Definitions for arbitrary-precision modules (only valid after     */
   /* decNumber.h has been included)                                  */
   /* ---------------------------------------------------------------- */