decSingle.c 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. /* [email protected] */
  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. #include "decContext.h" // public includes
  22. #include "decSingle.h" // public includes
  23. /* Constant mappings for shared code */
  24. #define DECPMAX DECSINGLE_Pmax
  25. #define DECEMIN DECSINGLE_Emin
  26. #define DECEMAX DECSINGLE_Emax
  27. #define DECEMAXD DECSINGLE_EmaxD
  28. #define DECBYTES DECSINGLE_Bytes
  29. #define DECSTRING DECSINGLE_String
  30. #define DECECONL DECSINGLE_EconL
  31. #define DECBIAS DECSINGLE_Bias
  32. #define DECLETS DECSINGLE_Declets
  33. #define DECQTINY (-DECSINGLE_Bias)
  34. // parameters of next-wider format
  35. #define DECWBYTES DECDOUBLE_Bytes
  36. #define DECWPMAX DECDOUBLE_Pmax
  37. #define DECWECONL DECDOUBLE_EconL
  38. #define DECWBIAS DECDOUBLE_Bias
  39. /* Type and function mappings for shared code */
  40. #define decFloat decSingle // Type name
  41. #define decFloatWider decDouble // Type name
  42. // Utility (binary results, extractors, etc.)
  43. #define decFloatFromBCD decSingleFromBCD
  44. #define decFloatFromPacked decSingleFromPacked
  45. #define decFloatFromPackedChecked decSingleFromPackedChecked
  46. #define decFloatFromString decSingleFromString
  47. #define decFloatFromWider decSingleFromWider
  48. #define decFloatGetCoefficient decSingleGetCoefficient
  49. #define decFloatGetExponent decSingleGetExponent
  50. #define decFloatSetCoefficient decSingleSetCoefficient
  51. #define decFloatSetExponent decSingleSetExponent
  52. #define decFloatShow decSingleShow
  53. #define decFloatToBCD decSingleToBCD
  54. #define decFloatToEngString decSingleToEngString
  55. #define decFloatToPacked decSingleToPacked
  56. #define decFloatToString decSingleToString
  57. #define decFloatToWider decSingleToWider
  58. #define decFloatZero decSingleZero
  59. // Non-computational
  60. #define decFloatRadix decSingleRadix
  61. #define decFloatVersion decSingleVersion
  62. #include "decNumberLocal.h" // local includes (need DECPMAX)
  63. #include "decCommon.c" // non-basic decFloat routines
  64. // [Do not include decBasic.c for decimal32]