GDB (xrefs)
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends | List of all members
gdb_mpq Struct Reference

#include "gmp-utils.h"

Public Member Functions

 gdb_mpq ()
 
 gdb_mpq (const mpq_t &from_val)
 
 gdb_mpq (const gdb_mpq &from)
 
 gdb_mpq (gdb_mpq &&from)
 
 gdb_mpq (const gdb_mpz &num, const gdb_mpz &denom)
 
 gdb_mpq (long num, long denom)
 
gdb_mpqoperator= (const gdb_mpq &from)
 
gdb_mpqoperator= (gdb_mpq &&from)
 
gdb_mpqoperator= (const gdb_mpz &from)
 
gdb_mpqoperator= (double d)
 
int sgn () const
 
gdb_mpq operator+ (const gdb_mpq &other) const
 
gdb_mpq operator- (const gdb_mpq &other) const
 
gdb_mpq operator* (const gdb_mpq &other) const
 
gdb_mpq operator/ (const gdb_mpq &other) const
 
gdb_mpqoperator*= (const gdb_mpq &other)
 
gdb_mpqoperator/= (const gdb_mpq &other)
 
bool operator== (const gdb_mpq &other) const
 
bool operator< (const gdb_mpq &other) const
 
std::string str () const
 
gdb_mpz get_rounded () const
 
gdb_mpz as_integer () const
 
double as_double () const
 
void read_fixed_point (gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order, bool unsigned_p, const gdb_mpq &scaling_factor)
 
void write_fixed_point (gdb::array_view< gdb_byte > buf, enum bfd_endian byte_order, bool unsigned_p, const gdb_mpq &scaling_factor) const
 
 ~gdb_mpq ()
 

Private Attributes

mpq_t m_val
 

Friends

struct gdb_mpf
 

Detailed Description

Definition at line 389 of file gmp-utils.h.

Constructor & Destructor Documentation

◆ gdb_mpq() [1/6]

gdb_mpq::gdb_mpq ( )
inline

Definition at line 392 of file gmp-utils.h.

References m_val.

◆ gdb_mpq() [2/6]

gdb_mpq::gdb_mpq ( const mpq_t & from_val)
inlineexplicit

Definition at line 394 of file gmp-utils.h.

References m_val.

◆ gdb_mpq() [3/6]

gdb_mpq::gdb_mpq ( const gdb_mpq & from)
inline

Definition at line 400 of file gmp-utils.h.

References m_val.

◆ gdb_mpq() [4/6]

gdb_mpq::gdb_mpq ( gdb_mpq && from)
inlineexplicit

Definition at line 406 of file gmp-utils.h.

References m_val.

◆ gdb_mpq() [5/6]

gdb_mpq::gdb_mpq ( const gdb_mpz & num,
const gdb_mpz & denom )
inline

Definition at line 412 of file gmp-utils.h.

References gdb_mpz::m_val, and m_val.

◆ gdb_mpq() [6/6]

gdb_mpq::gdb_mpq ( long num,
long denom )
inline

Definition at line 420 of file gmp-utils.h.

References m_val.

◆ ~gdb_mpq()

gdb_mpq::~gdb_mpq ( )
inline

Definition at line 549 of file gmp-utils.h.

References m_val.

Member Function Documentation

◆ as_double()

double gdb_mpq::as_double ( ) const
inline

Definition at line 522 of file gmp-utils.h.

References m_val.

Referenced by value_cast().

◆ as_integer()

gdb_mpz gdb_mpq::as_integer ( ) const
inline

Definition at line 514 of file gmp-utils.h.

References gdb_mpz::m_val, and m_val.

Referenced by unpack_long().

◆ get_rounded()

gdb_mpz gdb_mpq::get_rounded ( ) const

Definition at line 177 of file gmp-utils.c.

References gdb_mpz::m_val, and m_val.

Referenced by value_cast_to_fixed_point(), and write_fixed_point().

◆ operator*()

gdb_mpq gdb_mpq::operator* ( const gdb_mpq & other) const
inline

Definition at line 471 of file gmp-utils.h.

References m_val.

◆ operator*=()

gdb_mpq & gdb_mpq::operator*= ( const gdb_mpq & other)
inline

Definition at line 485 of file gmp-utils.h.

References m_val.

◆ operator+()

gdb_mpq gdb_mpq::operator+ ( const gdb_mpq & other) const
inline

Definition at line 457 of file gmp-utils.h.

References m_val.

◆ operator-()

gdb_mpq gdb_mpq::operator- ( const gdb_mpq & other) const
inline

Definition at line 464 of file gmp-utils.h.

References m_val.

◆ operator/()

gdb_mpq gdb_mpq::operator/ ( const gdb_mpq & other) const
inline

Definition at line 478 of file gmp-utils.h.

References m_val.

◆ operator/=()

gdb_mpq & gdb_mpq::operator/= ( const gdb_mpq & other)
inline

Definition at line 491 of file gmp-utils.h.

References m_val.

◆ operator<()

bool gdb_mpq::operator< ( const gdb_mpq & other) const
inline

Definition at line 502 of file gmp-utils.h.

References m_val.

◆ operator=() [1/4]

gdb_mpq & gdb_mpq::operator= ( const gdb_mpq & from)
inline

Definition at line 428 of file gmp-utils.h.

References m_val.

◆ operator=() [2/4]

gdb_mpq & gdb_mpq::operator= ( const gdb_mpz & from)
inline

Definition at line 440 of file gmp-utils.h.

References gdb_mpz::m_val, and m_val.

◆ operator=() [3/4]

gdb_mpq & gdb_mpq::operator= ( double d)
inline

Definition at line 446 of file gmp-utils.h.

References m_val.

◆ operator=() [4/4]

gdb_mpq & gdb_mpq::operator= ( gdb_mpq && from)
inline

Definition at line 434 of file gmp-utils.h.

References m_val.

◆ operator==()

bool gdb_mpq::operator== ( const gdb_mpq & other) const
inline

Definition at line 497 of file gmp-utils.h.

References m_val.

◆ read_fixed_point()

void gdb_mpq::read_fixed_point ( gdb::array_view< const gdb_byte > buf,
enum bfd_endian byte_order,
bool unsigned_p,
const gdb_mpq & scaling_factor )

◆ sgn()

int gdb_mpq::sgn ( ) const
inline

Definition at line 454 of file gmp-utils.h.

References m_val.

◆ str()

std::string gdb_mpq::str ( ) const
inline

Definition at line 508 of file gmp-utils.h.

References gmp_string_printf(), and m_val.

Referenced by print_fixed_point_type_info(), and print_type_fixed_point().

◆ write_fixed_point()

void gdb_mpq::write_fixed_point ( gdb::array_view< gdb_byte > buf,
enum bfd_endian byte_order,
bool unsigned_p,
const gdb_mpq & scaling_factor ) const

Definition at line 224 of file gmp-utils.c.

References get_rounded(), m_val, and gdb_mpz::write().

Referenced by selftests::write_fp_test().

Friends And Related Symbol Documentation

◆ gdb_mpf

friend struct gdb_mpf
friend

Definition at line 553 of file gmp-utils.h.

Member Data Documentation

◆ m_val

mpq_t gdb_mpq::m_val
private

The documentation for this struct was generated from the following files: