-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbigintegerobject2.h
59 lines (36 loc) · 1.13 KB
/
bigintegerobject2.h
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
#ifndef BIGINTEGEROBJECT2_H
#define BIGINTEGEROBJECT2_H
#include <QObject>
#include <QJSValue>
#include <QVariant>
#include <QQmlEngine>
/// BigInteger 2.0
class BigIntegerObject2 : public QObject
{
Q_OBJECT
public:
explicit BigIntegerObject2(QObject *parent = 0);
QQmlEngine *engine() const;
void setEngine(QQmlEngine *engine);
signals:
public slots:
QJSValue create();
QJSValue create(QJSValue value);
QJSValue fraction(qreal input, bool normalize = true);
QVariant _createValue(QJSValue value) const;
bool equals(QJSValue a, QJSValue b) const;
QString _toString(QJSValue a) const;
QJSValue _add(QJSValue a, QJSValue value) const;
QJSValue _minus(QJSValue a, QJSValue value) const;
QJSValue _multiply(QJSValue a, QJSValue value) const;
QJSValue _divide(QJSValue a, QJSValue b) const;
bool isNegative(QJSValue a) const;
int compare(QJSValue a, QJSValue b) const;
QJSValue abs(QJSValue a);
QJSValue gcd(QJSValue a, QJSValue b);
QJSValue pow(QJSValue base, int exponent);
private:
QQmlEngine* m_engine;
QJSValue creator;
};
#endif // BIGINTEGEROBJECT2_H