Fix to UriTemplate.Match to properly handle query parameters without a value. No...
[mono.git] / mono / metadata / decimal.h
1 #ifndef _MONO_DECIMAL_H_
2 #define _MONO_DECIMAL_H_
3
4 #include <glib.h>
5 #include "mono/metadata/object.h"
6 #include "mono/utils/mono-compiler.h"
7
8 /* representation for C# type decimal */
9 /* This is the layout of MSC */
10 typedef struct
11 {
12         union {
13                 guint32 ss32;
14 #if G_BYTE_ORDER != G_LITTLE_ENDIAN
15             struct {
16                     unsigned int sign      : 1;
17                     unsigned int reserved2 : 7;
18                     unsigned int scale     : 8;
19                     unsigned int reserved1 : 16;
20             } signscale;
21 #else
22             struct {
23                     unsigned int reserved1 : 16;
24                     unsigned int scale     : 8;
25                     unsigned int reserved2 : 7;
26                     unsigned int sign      : 1;
27             } signscale;
28 #endif
29         } u;
30     guint32 hi32;
31     guint32 lo32;
32     guint32 mid32;
33 } decimal_repr;
34
35
36 /* function prototypes */
37 gint32 mono_decimalIncr(/*[In, Out]*/decimal_repr* pA, /*[In]*/decimal_repr* pB) MONO_INTERNAL;
38 gint32 mono_double2decimal(/*[Out]*/decimal_repr* pA, double val, gint32 digits) MONO_INTERNAL;
39 gint32 mono_decimal2UInt64(/*[In]*/decimal_repr* pD, guint64* pResult) MONO_INTERNAL;
40 gint32 mono_decimal2Int64(/*[In]*/decimal_repr* pD, gint64* pResult) MONO_INTERNAL;
41 void mono_decimalFloorAndTrunc(/*[In, Out]*/decimal_repr* pD, gint32 floorFlag) MONO_INTERNAL;
42 void mono_decimalRound(/*[In, Out]*/decimal_repr* pD, gint32 decimals) MONO_INTERNAL;
43 gint32 mono_decimalMult(/*[In, Out]*/decimal_repr* pA, /*[In]*/decimal_repr* pB) MONO_INTERNAL;
44 gint32 mono_decimalDiv(/*[Out]*/decimal_repr* pC, /*[In]*/decimal_repr* pA, /*[In]*/decimal_repr* pB) MONO_INTERNAL;
45 gint32 mono_decimalIntDiv(/*[Out]*/decimal_repr* pC, /*[In]*/decimal_repr* pA, /*[In]*/decimal_repr* pB) MONO_INTERNAL;
46 gint32 mono_decimalCompare(/*[In]*/decimal_repr* pA, /*[In]*/decimal_repr* pB) MONO_INTERNAL;
47 double mono_decimal2double(/*[In]*/decimal_repr* pA) MONO_INTERNAL;
48 gint32 mono_decimalSetExponent(/*[In, Out]*/decimal_repr* pA, gint32 texp) MONO_INTERNAL;
49
50 gint32 mono_string2decimal(/*[Out]*/decimal_repr* pA, /*[In]*/MonoString* s, gint32 decrDecimal, gint32 sign) MONO_INTERNAL;
51
52 #endif