Safeheron-SGX-Native-Development-Framework v1.2.0
Loading...
Searching...
No Matches
ssgx::decimal_t Namespace Reference

This module is designed high precision numbers operations in enclave, a Trusted Execution Environment (TEE). More...

Classes

class  BigDecimal
 High precision big number class This class implements the basic calculation and comparison operations of high-precision big number library based on mpdecimal C language APIs. More...
 
class  Precision
 Precision control class The Precision class is used to configure the number of digits and rounding type of the BigDecimal calculation result. More...
 

Enumerations

enum class  RoundType {
  RoundUp = 0 , RoundDown = 1 , RoundCeiling = 2 , RoundFloor = 3 ,
  RoundHalfUp = 4 , RoundHalfDown = 5 , RoundHalfEven = 6 , Round05Up = 7 ,
  RoundTrunc = 8
}
 Rounding type for precision control. More...
 

Detailed Description

This module is designed high precision numbers operations in enclave, a Trusted Execution Environment (TEE).

This module depends on project https://github.com/Safeheron/mpdecimal.git (branch v4.0.0_sgx), which is the Intel SGX version of mpdecimal (https://www.bytereef.org/mpdecimal). mpdeicmal has APIs in both C and C++ languages, only C APIs are used in this module. (See https://www.bytereef.org/mpdecimal/doc/libmpdec/index.html)

The main functions are as follows:

  • Addition
  • Subtraction
  • Multiplication
  • Division
  • Comparison
  • Rounding
  • Output as a string
Note
Big number operations and precision control might cause exceptions, please refer comments for each functions.

Enumeration Type Documentation

◆ RoundType

enum class ssgx::decimal_t::RoundType
strong

Rounding type for precision control.

Enumerator
RoundUp 
RoundDown 
RoundCeiling 
RoundFloor 
RoundHalfUp 
RoundHalfDown 
RoundHalfEven 
Round05Up 
RoundTrunc