Products Support Documentation Download
rdmbcdapi.h
Go to the documentation of this file.
1 /*
2  * Raima Database Manager
3  *
4  * Copyright (C) 2016 Raims Inc., All rights reserved.
5  *
6  * Use of this software, whether in source code format, or in executable,
7  * binary object code form, is governed by the Raima LICENSE which
8  * is fully described in the LICENSE.TXT file, included within this
9  * distribution of files.
10  */
11 
16 #include "rdmbcdtypes.h"
17 #include "rdmretcodetypes.h"
18 
19 #if defined(RDM_UNICODE)
20 #define rdm_bcdFromString RDM_T_FUNC (rdm_bcdFromString)
21 #define rdm_bcdToString RDM_T_FUNC (rdm_bcdToString)
22 #define rdm_bcdToStringWithScale RDM_T_FUNC (rdm_bcdToStringWithScale)
23 #endif
24 
34 #if defined(__cplusplus)
35 extern "C" {
36 #endif
37 
44 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdAdd (
45  const RDM_BCD_T *operand1,
46  const RDM_BCD_T *operand2,
47  RDM_BCD_ROUNDING_MODE rounding_mode,
48  RDM_BCD_T *result
49 );
50 
57 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdAddDouble (
58  const RDM_BCD_T *operand1,
59  double operand2,
60  RDM_BCD_ROUNDING_MODE rounding_mode,
61  RDM_BCD_T *result
62 );
63 
70 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdAddInt32 (
71  const RDM_BCD_T *operand1,
72  int32_t operand2,
73  RDM_BCD_ROUNDING_MODE rounding_mode,
74  RDM_BCD_T *result
75 );
82 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdAddInt64 (
83  const RDM_BCD_T *operand1,
84  int64_t operand2,
85  RDM_BCD_ROUNDING_MODE rounding_mode,
86  RDM_BCD_T *result
87 );
94 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdAddUInt32 (
95  const RDM_BCD_T *operand1,
96  uint32_t operand2,
97  RDM_BCD_ROUNDING_MODE rounding_mode,
98  RDM_BCD_T *result
99 );
106 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdAddUInt64 (
107  const RDM_BCD_T *operand1,
108  uint64_t operand2,
109  RDM_BCD_ROUNDING_MODE rounding_mode,
110  RDM_BCD_T *result
111 );
112 
119 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdAdjust (
120  RDM_BCD_T *argument,
121  uint8_t precision,
122  uint8_t scale
123 );
124 
132 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdCeiling (
133  const RDM_BCD_T *operand,
134  RDM_BCD_T *result
135 );
136 
143 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdChgSign (
144  const RDM_BCD_T *operand,
145  RDM_BCD_T *result
146 );
147 
157 RDM_EXPORT RDM_COMPARE EXTERNAL_FCN rdm_bcdCompare (
158  const RDM_BCD_T *operand1,
159  const RDM_BCD_T *operand2
160 );
161 
168 RDM_EXPORT void EXTERNAL_FCN rdm_bcdCopy (
169  const RDM_BCD_T *source,
170  RDM_BCD_T *result
171 );
172 
179 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdCos (
180  const RDM_BCD_T *operand,
181  RDM_BCD_ROUNDING_MODE rounding_mode,
182  RDM_BCD_T *result
183 );
190 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdCot (
191  const RDM_BCD_T *operand,
192  RDM_BCD_ROUNDING_MODE rounding_mode,
193  RDM_BCD_T *result
194 );
195 
202 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdCsc (
203  const RDM_BCD_T *operand,
204  RDM_BCD_ROUNDING_MODE rounding_mode,
205  RDM_BCD_T *result
206 );
207 
214 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdDiv (
215  const RDM_BCD_T *operand1,
216  const RDM_BCD_T *operand2,
217  RDM_BCD_ROUNDING_MODE rounding_mode,
218  RDM_BCD_T *result
219 );
220 
227 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdDivByDouble (
228  const RDM_BCD_T *operand1,
229  double operand2,
230  RDM_BCD_ROUNDING_MODE rounding_mode,
231  RDM_BCD_T *result
232 );
233 
240 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdDivByInt32 (
241  const RDM_BCD_T *operand1,
242  int32_t operand2,
243  RDM_BCD_ROUNDING_MODE rounding_mode,
244  RDM_BCD_T *result
245 );
246 
253 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdDivByInt64 (
254  const RDM_BCD_T *operand1,
255  int64_t operand2,
256  RDM_BCD_ROUNDING_MODE rounding_mode,
257  RDM_BCD_T *result
258 );
259 
266 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdDivByUInt32 (
267  const RDM_BCD_T *operand1,
268  uint32_t operand2,
269  RDM_BCD_ROUNDING_MODE rounding_mode,
270  RDM_BCD_T *result
271 );
272 
279 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdDivByUInt64 (
280  const RDM_BCD_T *operand1,
281  uint64_t operand2,
282  RDM_BCD_ROUNDING_MODE rounding_mode,
283  RDM_BCD_T *result
284 );
285 
292 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdDivDouble (
293  double operand1,
294  const RDM_BCD_T *operand2,
295  RDM_BCD_ROUNDING_MODE rounding_mode,
296  RDM_BCD_T *result
297 );
298 
305 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdDivInt32 (
306  int32_t operand1,
307  const RDM_BCD_T *operand2,
308  RDM_BCD_ROUNDING_MODE rounding_mode,
309  RDM_BCD_T *result
310 );
311 
318 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdDivInt64 (
319  int64_t operand1,
320  const RDM_BCD_T *operand2,
321  RDM_BCD_ROUNDING_MODE rounding_mode,
322  RDM_BCD_T *result
323 );
324 
331 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdDivUInt32 (
332  uint32_t operand1,
333  const RDM_BCD_T *operand2,
334  RDM_BCD_ROUNDING_MODE rounding_mode,
335  RDM_BCD_T *result
336 );
337 
344 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdDivUInt64 (
345  uint64_t operand1,
346  const RDM_BCD_T *operand2,
347  RDM_BCD_ROUNDING_MODE rounding_mode,
348  RDM_BCD_T *result
349 );
350 
357 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdExp (
358  const RDM_BCD_T *operand,
359  RDM_BCD_ROUNDING_MODE rounding_mode,
360  RDM_BCD_T *result
361 );
362 
369 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFloor (
370  const RDM_BCD_T *operand,
371  RDM_BCD_T *result
372 );
373 
380 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFromDouble (
381  double operand,
382  RDM_BCD_T *result
383 );
384 
391 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFromFloat (
392  float operand,
393  RDM_BCD_T *result
394 );
395 
402 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFromInt16 (
403  int16_t operand,
404  RDM_BCD_T *result
405 );
406 
413 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFromInt32 (
414  int32_t operand,
415  RDM_BCD_T *result
416 );
417 
424 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFromInt64 (
425  int64_t operand,
426  RDM_BCD_T *result
427 );
428 
435 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFromInt8 (
436  int8_t operand,
437  RDM_BCD_T *result
438 );
439 
446 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFromString (
447  const RDM_TCHAR_T *operand,
448  RDM_BCD_T *result
449 );
450 
457 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFromUInt16 (
458  uint16_t operand,
459  RDM_BCD_T *result
460 );
461 
468 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFromUInt32 (
469  uint32_t operand,
470  RDM_BCD_T *result
471 );
472 
479 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFromUInt64 (
480  uint64_t operand,
481  RDM_BCD_T *result
482 );
483 
490 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdFromUInt8 (
491  uint8_t operand,
492  RDM_BCD_T *result
493 );
494 
503 RDM_EXPORT RDM_BOOL_T EXTERNAL_FCN rdm_bcdIsZero (
504  const RDM_BCD_T *argument
505 );
506 
513 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdLog (
514  const RDM_BCD_T *operand,
515  RDM_BCD_ROUNDING_MODE rounding_mode,
516  RDM_BCD_T *result
517 );
518 
525 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdLog10 (
526  const RDM_BCD_T *operand,
527  RDM_BCD_ROUNDING_MODE rounding_mode,
528  RDM_BCD_T *result
529 );
530 
538 RDM_EXPORT uint8_t EXTERNAL_FCN rdm_bcdMaxprec (void);
539 
547 RDM_EXPORT uint8_t EXTERNAL_FCN rdm_bcdMaxscale (void);
548 
555 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdMult (
556  const RDM_BCD_T *operand1,
557  const RDM_BCD_T *operand2,
558  RDM_BCD_ROUNDING_MODE rounding_mode,
559  RDM_BCD_T *result
560 );
561 
568 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdMultDouble (
569  const RDM_BCD_T *operand1,
570  double operand2,
571  RDM_BCD_ROUNDING_MODE rounding_mode,
572  RDM_BCD_T *result
573 );
574 
581 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdMultInt32 (
582  const RDM_BCD_T *operand1,
583  int32_t operand2,
584  RDM_BCD_ROUNDING_MODE rounding_mode,
585  RDM_BCD_T *result
586 );
587 
594 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdMultInt64 (
595  const RDM_BCD_T *operand1,
596  int64_t operand2,
597  RDM_BCD_ROUNDING_MODE rounding_mode,
598  RDM_BCD_T *result
599 );
600 
607 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdMultUInt32 (
608  const RDM_BCD_T *operand1,
609  uint32_t operand2,
610  RDM_BCD_ROUNDING_MODE rounding_mode,
611  RDM_BCD_T *result
612 );
613 
620 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdMultUInt64 (
621  const RDM_BCD_T *operand1,
622  uint64_t operand2,
623  RDM_BCD_ROUNDING_MODE rounding_mode,
624  RDM_BCD_T *result
625 );
626 
633 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdPi (
634  RDM_BCD_ROUNDING_MODE rounding_mode,
635  RDM_BCD_T *pi /***< [out] Pi result value */
636 );
637 
644 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdPow (
645  const RDM_BCD_T *operand1,
646  const RDM_BCD_T *operand2,
647  RDM_BCD_ROUNDING_MODE rounding_mode,
648  RDM_BCD_T *result
649 );
650 
657 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdPowInt32 (
658  const RDM_BCD_T *operand1,
659  int32_t operand2,
660  RDM_BCD_ROUNDING_MODE rounding_mode,
661  RDM_BCD_T *result
662 );
663 
670 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdPowInt64 (
671  const RDM_BCD_T *operand1,
672  int64_t operand2,
673  RDM_BCD_ROUNDING_MODE rounding_mode,
674  RDM_BCD_T *result
675 );
676 
683 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdPowUInt32 (
684  const RDM_BCD_T *operand1,
685  uint32_t operand2,
686  RDM_BCD_ROUNDING_MODE rounding_mode,
687  RDM_BCD_T *result
688 );
689 
696 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdPowUInt64 (
697  const RDM_BCD_T *operand1,
698  uint64_t operand2,
699  RDM_BCD_ROUNDING_MODE rounding_mode,
700  RDM_BCD_T *result
701 );
702 
709 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdReciprocal (
710  const RDM_BCD_T *operand,
711  RDM_BCD_ROUNDING_MODE rounding_mode,
712  RDM_BCD_T *result
713 );
714 
722 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdRound (
723  const RDM_BCD_T *operand,
724  RDM_BCD_T *result
725 );
726 
733 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSec (
734  const RDM_BCD_T *operand,
735  RDM_BCD_ROUNDING_MODE rounding_mode,
736  RDM_BCD_T *result
737 );
738 
748 RDM_EXPORT int16_t EXTERNAL_FCN rdm_bcdSign (
749  const RDM_BCD_T *argument
750 );
751 
758 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSin (
759  const RDM_BCD_T *operand,
760  RDM_BCD_ROUNDING_MODE rounding_mode,
761  RDM_BCD_T *result
762 );
763 
770 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSqrt (
771  const RDM_BCD_T *operand,
772  RDM_BCD_ROUNDING_MODE rounding_mode,
773  RDM_BCD_T *result
774 );
775 
782 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSub (
783  const RDM_BCD_T *operand1,
784  const RDM_BCD_T *operand2,
785  RDM_BCD_ROUNDING_MODE rounding_mode,
786  RDM_BCD_T *result
787 );
788 
795 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSubDouble (
796  const RDM_BCD_T *operand1,
797  double operand2,
798  RDM_BCD_ROUNDING_MODE rounding_mode,
799  RDM_BCD_T *result
800 );
801 
808 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSubFromDouble (
809  double operand1,
810  const RDM_BCD_T *operand2,
811  RDM_BCD_ROUNDING_MODE rounding_mode,
812  RDM_BCD_T *result
813 );
814 
821 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSubFromInt32 (
822  int32_t operand1,
823  const RDM_BCD_T *operand2,
824  RDM_BCD_ROUNDING_MODE rounding_mode,
825  RDM_BCD_T *result
826 );
827 
834 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSubFromInt64 (
835  int64_t operand1,
836  const RDM_BCD_T *operand2,
837  RDM_BCD_ROUNDING_MODE rounding_mode,
838  RDM_BCD_T *result
839 );
840 
847 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSubFromUInt32 (
848  uint32_t operand1,
849  const RDM_BCD_T *operand2,
850  RDM_BCD_ROUNDING_MODE rounding_mode,
851  RDM_BCD_T *result
852 );
853 
860 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSubFromUInt64 (
861  uint64_t operand1,
862  const RDM_BCD_T *operand2,
863  RDM_BCD_ROUNDING_MODE rounding_mode,
864  RDM_BCD_T *result
865 );
866 
873 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSubInt32 (
874  const RDM_BCD_T *operand1,
875  int32_t operand2,
876  RDM_BCD_ROUNDING_MODE rounding_mode,
877  RDM_BCD_T *result
878 );
879 
886 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSubInt64 (
887  const RDM_BCD_T *operand1,
888  int64_t operand2,
889  RDM_BCD_ROUNDING_MODE rounding_mode,
890  RDM_BCD_T *result
891 );
892 
899 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSubUInt32 (
900  const RDM_BCD_T *operand1,
901  uint32_t operand2,
902  RDM_BCD_ROUNDING_MODE rounding_mode,
903  RDM_BCD_T *result
904 );
905 
912 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdSubUInt64 (
913  const RDM_BCD_T *operand1,
914  uint64_t operand2,
915  RDM_BCD_ROUNDING_MODE rounding_mode,
916  RDM_BCD_T *result
917 );
918 
925 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdTan (
926  const RDM_BCD_T *operand,
927  RDM_BCD_ROUNDING_MODE rounding_mode,
928  RDM_BCD_T *result
929 );
930 
937 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToDouble (
938  const RDM_BCD_T *operand,
939  double *result
940 );
941 
948 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToFloat (
949  const RDM_BCD_T *operand,
950  float *result
951 );
952 
959 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToInt16 (
960  const RDM_BCD_T *operand,
961  int16_t *result
962 );
963 
970 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToInt32 (
971  const RDM_BCD_T *operand,
972  int32_t *result
973 );
974 
981 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToInt64 (
982  const RDM_BCD_T *operand,
983  int64_t *result
984 );
985 
992 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToInt8 (
993  const RDM_BCD_T *operand,
994  int8_t *result
995 );
996 
1006 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToString (
1007  const RDM_BCD_T *operand,
1008  RDM_BOOL_T useExponent,
1009  RDM_TCHAR_T *result,
1010  size_t inBytes,
1011  size_t *bytesOut
1012 );
1013 
1023 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToStringWithScale (
1024  const RDM_BCD_T *operand,
1025  uint8_t scale,
1026  RDM_BOOL_T useExponent,
1027  RDM_TCHAR_T *result,
1028  size_t inBytes,
1029  size_t *bytesOut
1030 );
1031 
1038 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToUInt16 (
1039  const RDM_BCD_T *operand,
1040  uint16_t *result
1041 );
1042 
1049 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToUInt32 (
1050  const RDM_BCD_T *operand,
1051  uint32_t *result
1052 );
1053 
1060 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToUInt64 (
1061  const RDM_BCD_T *operand,
1062  uint64_t *result
1063 );
1064 
1071 RDM_EXPORT RDM_RETCODE EXTERNAL_FCN rdm_bcdToUInt8 (
1072  const RDM_BCD_T *operand,
1073  uint8_t *result
1074 );
1075 
1076 #if defined(__cplusplus)
1077 }
1078 #endif
1079 
RDM_RETCODE rdm_bcdCsc(const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the cosecant of a number.
RDM_RETCODE rdm_bcdCeiling(const RDM_BCD_T *operand, RDM_BCD_T *result)
Take the ceiling of a number.
RDM_RETCODE rdm_bcdPowInt64(const RDM_BCD_T *operand1, int64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the power of a number.
RDM_RETCODE rdm_bcdToStringWithScale(const RDM_BCD_T *operand, uint8_t scale, RDM_BOOL_T useExponent, RDM_TCHAR_T *result, size_t inBytes, size_t *bytesOut)
Convert a BCD number with scale to a string.
RDM_RETCODE rdm_bcdToDouble(const RDM_BCD_T *operand, double *result)
Convert a BCD number to a double.
RDM_RETCODE rdm_bcdMultUInt64(const RDM_BCD_T *operand1, uint64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Multiply two numbers.
RDM_RETCODE rdm_bcdDivByInt32(const RDM_BCD_T *operand1, int32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers.
RDM_RETCODE rdm_bcdToString(const RDM_BCD_T *operand, RDM_BOOL_T useExponent, RDM_TCHAR_T *result, size_t inBytes, size_t *bytesOut)
Convert a BCD number to a string.
RDM_RETCODE rdm_bcdToUInt32(const RDM_BCD_T *operand, uint32_t *result)
Convert a BCD number to an uint32_t.
RDM_RETCODE rdm_bcdChgSign(const RDM_BCD_T *operand, RDM_BCD_T *result)
Change the sign of a number.
RDM_RETCODE rdm_bcdDivUInt64(uint64_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers.
RDM_RETCODE rdm_bcdRound(const RDM_BCD_T *operand, RDM_BCD_T *result)
Find the nearest integer of a BCD number.
RDM_RETCODE rdm_bcdPowUInt32(const RDM_BCD_T *operand1, uint32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the power of a number.
RDM_RETCODE rdm_bcdToInt64(const RDM_BCD_T *operand, int64_t *result)
Convert a BCD number to an int64_t.
RDM_BOOL_T
Definition: psptypes.h:57
RDM_RETCODE rdm_bcdSubInt32(const RDM_BCD_T *operand1, int32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers.
RDM_RETCODE rdm_bcdFromFloat(float operand, RDM_BCD_T *result)
Convert a float to a BCD number.
RDM_RETCODE rdm_bcdMult(const RDM_BCD_T *operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Multiply two numbers.
RDM_RETCODE rdm_bcdSubFromUInt32(uint32_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers.
RDM_RETCODE rdm_bcdToUInt16(const RDM_BCD_T *operand, uint16_t *result)
Convert a BCD number to an uint16_t.
RDM_RETCODE rdm_bcdDivByUInt64(const RDM_BCD_T *operand1, uint64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers.
RDM_RETCODE rdm_bcdFromDouble(double operand, RDM_BCD_T *result)
Convert a double to a BCD number.
uint8_t rdm_bcdMaxprec(void)
Return the maximum precision.
RDM_RETCODE rdm_bcdMultInt32(const RDM_BCD_T *operand1, int32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Multiply two numbers.
RDM_RETCODE rdm_bcdDivDouble(double operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers.
RDM_RETCODE rdm_bcdAddInt64(const RDM_BCD_T *operand1, int64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Add two numbers.
RDM_BCD_ROUNDING_MODE
Rounding modes for RDM BCD.
Definition: rdmbcdtypes.h:25
RDM_RETCODE rdm_bcdFromInt64(int64_t operand, RDM_BCD_T *result)
Convert an int64_t to a BCD number.
RDM_RETCODE rdm_bcdSubFromDouble(double operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers.
RDM Status and Error Return Codes.
uint8_t rdm_bcdMaxscale(void)
Return the scale.
RDM_RETCODE rdm_bcdToUInt8(const RDM_BCD_T *operand, uint8_t *result)
Convert a BCD number to an uint8_t.
RDM_RETCODE rdm_bcdMultUInt32(const RDM_BCD_T *operand1, uint32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Multiply two numbers.
RDM_RETCODE rdm_bcdSubUInt64(const RDM_BCD_T *operand1, uint64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers.
RDM_RETCODE rdm_bcdDivInt32(int32_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers.
RDM_RETCODE rdm_bcdToInt8(const RDM_BCD_T *operand, int8_t *result)
Convert a BCD number to an int8_t.
RDM_RETCODE rdm_bcdDivByInt64(const RDM_BCD_T *operand1, int64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers.
RDM_RETCODE rdm_bcdSubFromUInt64(uint64_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers.
RDM_RETCODE rdm_bcdAddUInt64(const RDM_BCD_T *operand1, uint64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Add two numbers.
RDM_RETCODE rdm_bcdAdd(const RDM_BCD_T *operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Add two numbers.
RDM_RETCODE rdm_bcdAddInt32(const RDM_BCD_T *operand1, int32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Add two numbers.
RDM_RETCODE rdm_bcdPi(RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *pi)
Pi.
RDM_COMPARE
Definition: psptypes.h:66
RDM_RETCODE rdm_bcdFromUInt16(uint16_t operand, RDM_BCD_T *result)
Convert an uint16_t to a BCD number.
RDM_COMPARE rdm_bcdCompare(const RDM_BCD_T *operand1, const RDM_BCD_T *operand2)
Compare two numbers.
RDM_RETCODE
RDM status and error return codes.
RDM_RETCODE rdm_bcdExp(const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the exponent of a number.
RDM_RETCODE rdm_bcdPowInt32(const RDM_BCD_T *operand1, int32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the power of a number.
void rdm_bcdCopy(const RDM_BCD_T *source, RDM_BCD_T *result)
Copy a BCD number.
RDM_RETCODE rdm_bcdAdjust(RDM_BCD_T *argument, uint8_t precision, uint8_t scale)
Adjust a BCD number.
RDM_RETCODE rdm_bcdFromUInt8(uint8_t operand, RDM_BCD_T *result)
Convert an uint8_t to a BCD number.
RDM_RETCODE rdm_bcdMultInt64(const RDM_BCD_T *operand1, int64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Multiply two numbers.
RDM_RETCODE rdm_bcdFromInt32(int32_t operand, RDM_BCD_T *result)
Convert an int32_t to a BCD number.
RDM_RETCODE rdm_bcdDivUInt32(uint32_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers.
RDM_RETCODE rdm_bcdCot(const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the cotangent of a number.
RDM_RETCODE rdm_bcdTan(const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the tangent of a number.
RDM_RETCODE rdm_bcdDivByUInt32(const RDM_BCD_T *operand1, uint32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers.
RDM_RETCODE rdm_bcdFromUInt64(uint64_t operand, RDM_BCD_T *result)
Convert an uint64_t to a BCD number.
RDM_RETCODE rdm_bcdFromInt16(int16_t operand, RDM_BCD_T *result)
Convert an int16_t to a BCD number.
RDM_RETCODE rdm_bcdDiv(const RDM_BCD_T *operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers.
RDM_RETCODE rdm_bcdLog(const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the natual logarithm of a number.
RDM_RETCODE rdm_bcdFromString(const RDM_TCHAR_T *operand, RDM_BCD_T *result)
Convert a string to a BCD number.
RDM_RETCODE rdm_bcdSin(const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the sine of a number.
RDM_BOOL_T rdm_bcdIsZero(const RDM_BCD_T *argument)
Is a number zero.
RDM_RETCODE rdm_bcdFromInt8(int8_t operand, RDM_BCD_T *result)
Convert an int8_t to a BCD number.
RDM_RETCODE rdm_bcdSec(const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the secant of a number.
RDM_RETCODE rdm_bcdSqrt(const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the square root of a number.
RDM_RETCODE rdm_bcdToInt32(const RDM_BCD_T *operand, int32_t *result)
Convert a BCD number to an int32_t.
Header for Binary-coded decimal (BCD) types.
RDM_RETCODE rdm_bcdDivInt64(int64_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers.
RDM_RETCODE rdm_bcdMultDouble(const RDM_BCD_T *operand1, double operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Multiply two numbers.
int16_t rdm_bcdSign(const RDM_BCD_T *argument)
Get the sign of a number.
RDM_RETCODE rdm_bcdFloor(const RDM_BCD_T *operand, RDM_BCD_T *result)
Take the floor of a number.
RDM_RETCODE rdm_bcdReciprocal(const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the reciprocal of a number.
RDM_RETCODE rdm_bcdAddUInt32(const RDM_BCD_T *operand1, uint32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Add two numbers.
RDM_RETCODE rdm_bcdPow(const RDM_BCD_T *operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the power of a number.
RDM_RETCODE rdm_bcdSubInt64(const RDM_BCD_T *operand1, int64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers.
RDM_RETCODE rdm_bcdLog10(const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the logarithm base 10 of a number.
RDM_RETCODE rdm_bcdCos(const RDM_BCD_T *operand, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the cosine of a number.
RDM_RETCODE rdm_bcdSub(const RDM_BCD_T *operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers.
RDM_RETCODE rdm_bcdToFloat(const RDM_BCD_T *operand, float *result)
Convert a BCD number to a float.
#define RDM_TCHAR_T
Definition: psptypes.h:130
RDM_RETCODE rdm_bcdPowUInt64(const RDM_BCD_T *operand1, uint64_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Take the power of a number.
RDM_RETCODE rdm_bcdSubDouble(const RDM_BCD_T *operand1, double operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers.
RDM_RETCODE rdm_bcdDivByDouble(const RDM_BCD_T *operand1, double operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Divide two numbers.
RDM_RETCODE rdm_bcdSubFromInt64(int64_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers.
RDM_RETCODE rdm_bcdToUInt64(const RDM_BCD_T *operand, uint64_t *result)
Convert a BCD number to an uint64_t.
RDM_RETCODE rdm_bcdSubUInt32(const RDM_BCD_T *operand1, uint32_t operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers.
The RDM Binary Coded Decimal (BCD) data structure.
Definition: rdmbcdtypes.h:64
RDM_RETCODE rdm_bcdAddDouble(const RDM_BCD_T *operand1, double operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Add two numbers.
RDM_RETCODE rdm_bcdSubFromInt32(int32_t operand1, const RDM_BCD_T *operand2, RDM_BCD_ROUNDING_MODE rounding_mode, RDM_BCD_T *result)
Subtract two numbers.
RDM_RETCODE rdm_bcdFromUInt32(uint32_t operand, RDM_BCD_T *result)
Convert an uint32_t to a BCD number.
RDM_RETCODE rdm_bcdToInt16(const RDM_BCD_T *operand, int16_t *result)
Convert a BCD number to an int16_t.