decSingle.c 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* decSingle module for the decNumber C Library.
  2. Copyright (C) 2007-2022 Free Software Foundation, Inc.
  3. Contributed by IBM Corporation. Author Mike Cowlishaw.
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify it under
  6. the terms of the GNU General Public License as published by the Free
  7. Software Foundation; either version 3, or (at your option) any later
  8. version.
  9. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. for more details.
  13. Under Section 7 of GPL version 3, you are granted additional
  14. permissions described in the GCC Runtime Library Exception, version
  15. 3.1, as published by the Free Software Foundation.
  16. You should have received a copy of the GNU General Public License and
  17. a copy of the GCC Runtime Library Exception along with this program;
  18. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. <http://www.gnu.org/licenses/>. */
  20. /* ------------------------------------------------------------------ */
  21. /* decSingle.c -- decSingle operations module */
  22. /* ------------------------------------------------------------------ */
  23. #include "decContext.h" /* public includes */
  24. #include "decSingle.h" /* public includes */
  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. /* Type and function mappings for shared code */
  42. #define decFloat decSingle /* Type name */
  43. #define decFloatWider decDouble /* Type name */
  44. /* Utility (binary results, extractors, etc.) */
  45. #define decFloatFromBCD decSingleFromBCD
  46. #define decFloatFromPacked decSingleFromPacked
  47. #define decFloatFromPackedChecked decSingleFromPackedChecked
  48. #define decFloatFromString decSingleFromString
  49. #define decFloatFromWider decSingleFromWider
  50. #define decFloatGetCoefficient decSingleGetCoefficient
  51. #define decFloatGetExponent decSingleGetExponent
  52. #define decFloatSetCoefficient decSingleSetCoefficient
  53. #define decFloatSetExponent decSingleSetExponent
  54. #define decFloatShow decSingleShow
  55. #define decFloatToBCD decSingleToBCD
  56. #define decFloatToEngString decSingleToEngString
  57. #define decFloatToPacked decSingleToPacked
  58. #define decFloatToString decSingleToString
  59. #define decFloatToWider decSingleToWider
  60. #define decFloatZero decSingleZero
  61. /* Non-computational */
  62. #define decFloatRadix decSingleRadix
  63. #define decFloatVersion decSingleVersion
  64. #include "decNumberLocal.h" /* local includes (need DECPMAX) */
  65. #include "decCommon.c" /* non-basic decFloat routines */
  66. /* [Do not include decBasic.c for decimal32] */