summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-02-19 18:58:27 +0200
committermonty@mysql.com <>2005-02-19 18:58:27 +0200
commit218e00ac681c300ddfb59889d8b6dd7faa0e71f6 (patch)
tree45069dd14961944b02845ab6e42f1993666f63e8 /include
parent7bc48798fce1b4010adbd074aa18784fcf0eb07e (diff)
downloadmariadb-git-218e00ac681c300ddfb59889d8b6dd7faa0e71f6.tar.gz
Fixed BUILD script to use --with-berkeley-db instead of --with-bdb
Lots of small fixes to multi-precision-math path Give Note for '123.4e' Added helper functions type 'val_string_from_real() Don't give warnings for end space for string2decimal() Changed storage of values for SP so that we can detect length of argument without strlen() Changed interface for str2dec() so that we must supple the pointer to the last character in the buffer
Diffstat (limited to 'include')
-rw-r--r--include/decimal.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/decimal.h b/include/decimal.h
index 1e0ee97c267..3f4a2122c57 100644
--- a/include/decimal.h
+++ b/include/decimal.h
@@ -17,7 +17,9 @@
#ifndef _decimal_h
#define _decimal_h
-typedef enum {TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR} decimal_round_mode;
+typedef enum
+{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR}
+ decimal_round_mode;
typedef int32 decimal_digit;
typedef struct st_decimal {
@@ -26,11 +28,10 @@ typedef struct st_decimal {
decimal_digit *buf;
} decimal;
+int internal_str2dec(const char *from, decimal *to, char **end, my_bool fixed);
int decimal2string(decimal *from, char *to, int *to_len,
int fixed_precision, int fixed_decimals,
char filler);
-int string2decimal(char *from, decimal *to, char **end);
-int string2decimal_fixed(char *from, decimal *to, char **end);
int decimal2ulonglong(decimal *from, ulonglong *to);
int ulonglong2decimal(ulonglong from, decimal *to);
int decimal2longlong(decimal *from, longlong *to);
@@ -51,10 +52,14 @@ int decimal_cmp(decimal *from1, decimal *from2);
int decimal_mul(decimal *from1, decimal *from2, decimal *to);
int decimal_div(decimal *from1, decimal *from2, decimal *to, int scale_incr);
int decimal_mod(decimal *from1, decimal *from2, decimal *to);
-int decimal_round(decimal *from, decimal *to, int new_scale, decimal_round_mode mode);
+int decimal_round(decimal *from, decimal *to, int new_scale,
+ decimal_round_mode mode);
int decimal_is_zero(decimal *from);
void max_decimal(int precision, int frac, decimal *to);
+#define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0)
+#define string2decimal_fixed(A,B,C) internal_str2dec((A), (B), (C), 1)
+
/* set a decimal to zero */
#define decimal_make_zero(dec) do { \