root/src/dps8/dps8_decimal.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * vim: filetype=c:tabstop=4:ai:expandtab
   3  * SPDX-License-Identifier: ICU
   4  * scspell-id: a5232a07-f62d-11ec-86fd-80ee73e9b8e7
   5  *
   6  * ---------------------------------------------------------------------------
   7  *
   8  * Copyright (c) 2012-2016 Harry Reed
   9  * Copyright (c) 2013-2016 Charles Anthony
  10  * Copyright (c) 2017 Michal Tomek
  11  * Copyright (c) 2021-2024 The DPS8M Development Team
  12  *
  13  * This software is made available under the terms of the ICU License.
  14  * See the LICENSE.md file at the top-level directory of this distribution.
  15  *
  16  * ---------------------------------------------------------------------------
  17  */
  18 
  19 #define DECUSE64       1
  20 #define DECSUBSET      1
  21 #define DECBUFFER     32
  22 #define DECNUMDIGITS 126
  23 
  24 #include "decNumber.h"        // base number library
  25 #include "decNumberLocal.h"   // decNumber local types, etc.
  26 
  27 #define PRINTDEC(msg, dn)                        \
  28     {                                            \
  29         if_sim_debug (DBG_TRACEEXT, & cpu_dev)   \
  30           {                                      \
  31             char temp[256];                      \
  32             decNumberToString(dn, temp);         \
  33             sim_printf("%s:'%s'\n", msg, temp);  \
  34           }                                      \
  35     }
  36 
  37 #define PRINTALL(msg, dn, set)                                                     \
  38     {                                                                              \
  39         if_sim_debug (DBG_TRACEEXT, & cpu_dev)                                     \
  40         sim_printf("%s:'%s E%d'\n", msg, getBCDn(dn, set->digits), dn->exponent);  \
  41     }
  42 
  43 decContext * decContextDefaultDPS8(decContext *context);
  44 decContext * decContextDefaultDPS8Mul(decContext *context);
  45 decNumber  * decBCD9ToNumber(const word9 *bcd, Int length, const Int scale, decNumber *dn);
  46 char *formatDecimal(uint8_t * out, decContext *set, decNumber *r, int nout, int s,
  47                     int sf, bool R, bool *OVR, bool *TRUNC);
  48 //uint8_t * decBCDFromNumber(uint8_t *bcd, int length, int *scale, const decNumber *dn);
  49 //unsigned char *getBCD(decNumber *a);
  50 //char *getBCDn(decNumber *a, int digits);
  51 //int decCompare(decNumber *lhs, decNumber *rhs, decContext *set);
  52 int decCompareMAG(decNumber *lhs, decNumber *rhs, decContext *set);

/* [previous][next][first][last][top][bottom][index][help] */