github.com/matrixorigin/matrixone@v0.7.0/cgo/external/decNumber/decSingle.c (about)

     1  /* ------------------------------------------------------------------ */
     2  /* decSingle.c -- decSingle operations module                         */
     3  /* ------------------------------------------------------------------ */
     4  /* Copyright (c) IBM Corporation, 2000, 2008.  All rights reserved.   */
     5  /*                                                                    */
     6  /* This software is made available under the terms of the             */
     7  /* ICU License -- ICU 1.8.1 and later.                                */
     8  /*                                                                    */
     9  /* The description and User's Guide ("The decNumber C Library") for   */
    10  /* this software is included in the package as decNumber.pdf.  This   */
    11  /* document is also available in HTML, together with specifications,  */
    12  /* testcases, and Web links, on the General Decimal Arithmetic page.  */
    13  /*                                                                    */
    14  /* Please send comments, suggestions, and corrections to the author:  */
    15  /*   mfc@uk.ibm.com                                                   */
    16  /*   Mike Cowlishaw, IBM Fellow                                       */
    17  /*   IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK         */
    18  /* ------------------------------------------------------------------ */
    19  /* This module comprises decSingle operations (including conversions) */
    20  /* ------------------------------------------------------------------ */
    21  
    22  #include "decContext.h"       // public includes
    23  #include "decSingle.h"        // public includes
    24  
    25  /* Constant mappings for shared code */
    26  #define DECPMAX     DECSINGLE_Pmax
    27  #define DECEMIN     DECSINGLE_Emin
    28  #define DECEMAX     DECSINGLE_Emax
    29  #define DECEMAXD    DECSINGLE_EmaxD
    30  #define DECBYTES    DECSINGLE_Bytes
    31  #define DECSTRING   DECSINGLE_String
    32  #define DECECONL    DECSINGLE_EconL
    33  #define DECBIAS     DECSINGLE_Bias
    34  #define DECLETS     DECSINGLE_Declets
    35  #define DECQTINY    (-DECSINGLE_Bias)
    36  // parameters of next-wider format
    37  #define DECWBYTES   DECDOUBLE_Bytes
    38  #define DECWPMAX    DECDOUBLE_Pmax
    39  #define DECWECONL   DECDOUBLE_EconL
    40  #define DECWBIAS    DECDOUBLE_Bias
    41  
    42  /* Type and function mappings for shared code */
    43  #define decFloat                   decSingle      // Type name
    44  #define decFloatWider              decDouble      // Type name
    45  
    46  // Utility (binary results, extractors, etc.)
    47  #define decFloatFromBCD            decSingleFromBCD
    48  #define decFloatFromPacked         decSingleFromPacked
    49  #define decFloatFromPackedChecked  decSingleFromPackedChecked
    50  #define decFloatFromString         decSingleFromString
    51  #define decFloatFromWider          decSingleFromWider
    52  #define decFloatGetCoefficient     decSingleGetCoefficient
    53  #define decFloatGetExponent        decSingleGetExponent
    54  #define decFloatSetCoefficient     decSingleSetCoefficient
    55  #define decFloatSetExponent        decSingleSetExponent
    56  #define decFloatShow               decSingleShow
    57  #define decFloatToBCD              decSingleToBCD
    58  #define decFloatToEngString        decSingleToEngString
    59  #define decFloatToPacked           decSingleToPacked
    60  #define decFloatToString           decSingleToString
    61  #define decFloatToWider            decSingleToWider
    62  #define decFloatZero               decSingleZero
    63  
    64  // Non-computational
    65  #define decFloatRadix              decSingleRadix
    66  #define decFloatVersion            decSingleVersion
    67  
    68  #include "decNumberLocal.h"   // local includes (need DECPMAX)
    69  #include "decCommon.c"        // non-basic decFloat routines
    70  // [Do not include decBasic.c for decimal32]
    71