少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
 * \file
 */
 
#ifndef __MONO_NUMBER_MS_H__
#define __MONO_NUMBER_MS_H__
 
#include <glib.h>
 
// Double floating point Bias
#define MONO_DOUBLE_BIAS 1022
 
// Structure to access an encoded double floating point
typedef struct {
#if G_BYTE_ORDER == G_BIG_ENDIAN
    guint sign   : 1;
    guint exp    : 11;
    guint mantHi : 20;
    guint mantLo : 32;
#else // BIGENDIAN
    guint mantLo : 32;
    guint mantHi : 20;
    guint exp    : 11;
    guint sign   : 1;
#endif
} MonoDouble;
 
typedef union {
    MonoDouble s;
    gdouble d;
} MonoDouble_double;
 
// Single floating point Bias
#define MONO_SINGLE_BIAS 126
 
// Structure to access an encoded single floating point
typedef struct {
#if G_BYTE_ORDER == G_BIG_ENDIAN
    guint sign : 1;
    guint exp  : 8;
    guint mant : 23;
#else
    guint mant : 23;
    guint exp  : 8;
    guint sign : 1;
#endif
} MonoSingle;
 
typedef union {
    MonoSingle s;
    gfloat f;
} MonoSingle_float;
 
#define MONO_NUMBER_MAXDIGITS 50
 
typedef struct  {
    gint32 precision;
    gint32 scale;
    gint32 sign;
    guint16 digits [MONO_NUMBER_MAXDIGITS + 1];
    guint16 *allDigits;
} MonoNumber;
 
gint
mono_double_from_number (gpointer from, MonoDouble *target);
 
#endif