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-2022 The DPS8M Development Team
  12  *
  13  * All rights reserved.
  14  *
  15  * This software is made available under the terms of the ICU
  16  * License, version 1.8.1 or later.  For more details, see the
  17  * LICENSE.md file at the top-level directory of this distribution.
  18  *
  19  * ---------------------------------------------------------------------------
  20  */
  21 
  22 #define DECUSE64       1
  23 #define DECSUBSET      1
  24 #define DECBUFFER     32
  25 #define DECNUMDIGITS 126
  26 
  27 #include "decNumber.h"        // base number library
  28 #include "decNumberLocal.h"   // decNumber local types, etc.
  29 
  30 #define PRINTDEC(msg, dn)                        \
  31     {                                            \
  32         if_sim_debug (DBG_TRACEEXT, & cpu_dev)   \
  33           {                                      \
  34             char temp[256];                      \
  35             decNumberToString(dn, temp);         \
  36             sim_printf("%s:'%s'\n", msg, temp);  \
  37           }                                      \
  38     }
  39 
  40 #define PRINTALL(msg, dn, set)                                                     \
  41     {                                                                              \
  42         if_sim_debug (DBG_TRACEEXT, & cpu_dev)                                     \
  43         sim_printf("%s:'%s E%d'\n", msg, getBCDn(dn, set->digits), dn->exponent);  \
  44     }
  45 
  46 decContext * decContextDefaultDPS8(decContext *context);
  47 decContext * decContextDefaultDPS8Mul(decContext *context);
  48 decNumber  * decBCD9ToNumber(const word9 *bcd, Int length, const Int scale, decNumber *dn);
  49 char *formatDecimal(uint8_t * out, decContext *set, decNumber *r, int nout, int s,
  50                     int sf, bool R, bool *OVR, bool *TRUNC);
  51 //uint8_t * decBCDFromNumber(uint8_t *bcd, int length, int *scale, const decNumber *dn);
  52 //unsigned char *getBCD(decNumber *a);
  53 //char *getBCDn(decNumber *a, int digits);
  54 //int decCompare(decNumber *lhs, decNumber *rhs, decContext *set);
  55 int decCompareMAG(decNumber *lhs, decNumber *rhs, decContext *set);

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