Hazelcast C++ Client
Hazelcast C++ Client Library
Loading...
Searching...
No Matches
big_decimal.h
1/*
2 * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <vector>
19#include <boost/multiprecision/cpp_int.hpp>
20#include "hazelcast/util/export.h"
21
22#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
23#pragma warning(push)
24#pragma warning(disable : 4251) // for dll export
25#endif
26
27namespace hazelcast {
28namespace client {
43struct HAZELCAST_API big_decimal
44{
45 boost::multiprecision::cpp_int unscaled;
46 int32_t scale;
47};
48
49bool HAZELCAST_API
50operator==(const big_decimal& lhs, const big_decimal& rhs);
51
52bool HAZELCAST_API
53operator<(const big_decimal& lhs, const big_decimal& rhs);
54} // namespace client
55} // namespace hazelcast
56namespace std {
57template<>
58struct HAZELCAST_API hash<hazelcast::client::big_decimal>
59{
60 std::size_t operator()(const hazelcast::client::big_decimal& f) const;
61};
62} // namespace std
63namespace hazelcast {
64namespace client {
65namespace pimpl {
66
72
73void HAZELCAST_API
74twos_complement(std::vector<int8_t>& a);
75
86boost::multiprecision::cpp_int HAZELCAST_API
87from_bytes(std::vector<int8_t> v);
100std::vector<int8_t> HAZELCAST_API
101to_bytes(const boost::multiprecision::cpp_int& i);
102} // namespace pimpl
103} // namespace client
104} // namespace hazelcast
105#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
106#pragma warning(pop)
107#endif
STL namespace.
An arbitrary precision and scale floating point number.
Definition big_decimal.h:44