Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::BoundedDouble Class Reference

#include <NumericValue.h>

Public Member Functions

 BoundedDouble (double fVal)
 BoundedDouble (const BoundedDouble &rhs)
BoundedDouble & operator= (const BoundedDouble &rhs)
 BoundedDouble (BoundedDouble &&rhs)
BoundedDouble & operator= (BoundedDouble &&rhs)
virtual ~BoundedDouble ()
const double getFVal () const
bool is_plus_infinity () const
bool is_minus_infinity () const
bool is_infinity () const
void set_plus_infinity ()
void set_minus_infinity ()
bool is_zero () const
bool equal (const BoundedDouble &rhs) const
bool leq (const BoundedDouble &rhs) const
bool geq (const BoundedDouble &rhs) const
bool is_int () const
bool is_real () const
bool is_true () const
s64_t getNumeral () const
 Return Numeral.
s64_t getIntNumeral () const
double getRealNumeral () const
virtual const std::string to_string () const

Static Public Member Functions

static bool doubleEqual (double a, double b)
static BoundedDouble plus_infinity ()
static BoundedDouble minus_infinity ()
static bool isZero (const BoundedDouble &expr)
static double safeAdd (double lhs, double rhs)
static double safeMul (double lhs, double rhs)
static double safeDiv (double lhs, double rhs)
static BoundedDouble min (std::vector< BoundedDouble > &_l)
static BoundedDouble max (std::vector< BoundedDouble > &_l)

Protected Member Functions

 BoundedDouble ()=default

Protected Attributes

double _fVal

Friends

bool operator== (const BoundedDouble &lhs, const BoundedDouble &rhs)
 Reload operator.
bool operator!= (const BoundedDouble &lhs, const BoundedDouble &rhs)
bool operator> (const BoundedDouble &lhs, const BoundedDouble &rhs)
bool operator< (const BoundedDouble &lhs, const BoundedDouble &rhs)
bool operator<= (const BoundedDouble &lhs, const BoundedDouble &rhs)
bool operator>= (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator+ (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator- (const BoundedDouble &lhs)
BoundedDouble operator- (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator* (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator/ (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator% (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator^ (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator& (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator| (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator&& (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator|| (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator! (const BoundedDouble &lhs)
BoundedDouble operator>> (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble operator<< (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble ite (const BoundedDouble &cond, const BoundedDouble &lhs, const BoundedDouble &rhs)
std::ostream & operator<< (std::ostream &out, const BoundedDouble &expr)
bool eq (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble min (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble max (const BoundedDouble &lhs, const BoundedDouble &rhs)
BoundedDouble abs (const BoundedDouble &lhs)

Detailed Description

Bounded double numeric value

Definition at line 703 of file NumericValue.h.

Constructor & Destructor Documentation

◆ BoundedDouble() [1/4]

SVF::BoundedDouble::BoundedDouble ( )
protecteddefault

◆ BoundedDouble() [2/4]

SVF::BoundedDouble::BoundedDouble ( double fVal)
inline

Definition at line 711 of file NumericValue.h.

711: _fVal(fVal) {}

◆ BoundedDouble() [3/4]

SVF::BoundedDouble::BoundedDouble ( const BoundedDouble & rhs)
inline

Definition at line 713 of file NumericValue.h.

713: _fVal(rhs._fVal) {}

◆ BoundedDouble() [4/4]

SVF::BoundedDouble::BoundedDouble ( BoundedDouble && rhs)
inline

Definition at line 721 of file NumericValue.h.

721: _fVal(std::move(rhs._fVal)) {}

◆ ~BoundedDouble()

virtual SVF::BoundedDouble::~BoundedDouble ( )
inlinevirtual

Definition at line 729 of file NumericValue.h.

729{}

Member Function Documentation

◆ doubleEqual()

bool SVF::BoundedDouble::doubleEqual ( double a,
double b )
inlinestatic

Definition at line 731 of file NumericValue.h.

732 {
733 if (std::isinf(a) && std::isinf(b))
734 return a == b;
735 return std::fabs(a - b) < epsilon;
736 }
#define epsilon
cJSON * a
Definition cJSON.cpp:2560
const cJSON *const b
Definition cJSON.h:255

◆ equal()

bool SVF::BoundedDouble::equal ( const BoundedDouble & rhs) const
inline

Definition at line 788 of file NumericValue.h.

789 {
790 return doubleEqual(_fVal, rhs._fVal);
791 }
static bool doubleEqual(double a, double b)

◆ geq()

bool SVF::BoundedDouble::geq ( const BoundedDouble & rhs) const
inline

Definition at line 817 of file NumericValue.h.

818 {
819 if (is_infinity() ^ rhs.is_infinity())
820 {
821 if (is_infinity())
822 {
823 return is_plus_infinity();
824 }
825 else
826 {
827 return rhs.is_minus_infinity();
828 }
829 }
830 if (is_infinity() && rhs.is_infinity())
831 {
832 if (is_plus_infinity())
833 return true;
834 else
835 return rhs.is_minus_infinity();
836 }
837 else
838 return _fVal >= rhs._fVal;
839 }
bool is_plus_infinity() const
bool is_infinity() const

◆ getFVal()

const double SVF::BoundedDouble::getFVal ( ) const
inline

Definition at line 738 of file NumericValue.h.

739 {
740 return _fVal;
741 }

◆ getIntNumeral()

s64_t SVF::BoundedDouble::getIntNumeral ( ) const
inline

Definition at line 1252 of file NumericValue.h.

1253 {
1254 return getNumeral();
1255 }
s64_t getNumeral() const
Return Numeral.

◆ getNumeral()

s64_t SVF::BoundedDouble::getNumeral ( ) const
inline

Return Numeral.

Definition at line 1236 of file NumericValue.h.

1237 {
1238 if (is_minus_infinity())
1239 {
1240 return INT64_MIN;
1241 }
1242 else if (is_plus_infinity())
1243 {
1244 return INT64_MAX;
1245 }
1246 else
1247 {
1248 return std::round(_fVal);
1249 }
1250 }
bool is_minus_infinity() const

◆ getRealNumeral()

double SVF::BoundedDouble::getRealNumeral ( ) const
inline

Definition at line 1257 of file NumericValue.h.

1258 {
1259 return _fVal;
1260 }

◆ is_infinity()

bool SVF::BoundedDouble::is_infinity ( ) const
inline

Definition at line 753 of file NumericValue.h.

754 {
756 }

◆ is_int()

bool SVF::BoundedDouble::is_int ( ) const
inline

Definition at line 1092 of file NumericValue.h.

1093 {
1094 return _fVal == std::round(_fVal);
1095 }

◆ is_minus_infinity()

bool SVF::BoundedDouble::is_minus_infinity ( ) const
inline

Definition at line 748 of file NumericValue.h.

749 {
750 return _fVal == -std::numeric_limits<double>::infinity();
751 }

◆ is_plus_infinity()

bool SVF::BoundedDouble::is_plus_infinity ( ) const
inline

Definition at line 743 of file NumericValue.h.

744 {
745 return _fVal == std::numeric_limits<double>::infinity();
746 }

◆ is_real()

bool SVF::BoundedDouble::is_real ( ) const
inline

Definition at line 1096 of file NumericValue.h.

1097 {
1098 return !is_int();
1099 }
bool is_int() const

◆ is_true()

bool SVF::BoundedDouble::is_true ( ) const
inline

Definition at line 1230 of file NumericValue.h.

1231 {
1232 return _fVal != 0.0f;
1233 }

◆ is_zero()

bool SVF::BoundedDouble::is_zero ( ) const
inline

Definition at line 778 of file NumericValue.h.

779 {
780 return doubleEqual(_fVal, 0.0f);
781 }

◆ isZero()

bool SVF::BoundedDouble::isZero ( const BoundedDouble & expr)
inlinestatic

Definition at line 783 of file NumericValue.h.

784 {
785 return doubleEqual(expr.getFVal(), 0.0f);
786 }

◆ leq()

bool SVF::BoundedDouble::leq ( const BoundedDouble & rhs) const
inline

Definition at line 793 of file NumericValue.h.

794 {
795 if (is_infinity() ^ rhs.is_infinity())
796 {
797 if (is_infinity())
798 {
799 return is_minus_infinity();
800 }
801 else
802 {
803 return rhs.is_plus_infinity();
804 }
805 }
806 if (is_infinity() && rhs.is_infinity())
807 {
808 if (is_minus_infinity())
809 return true;
810 else
811 return rhs.is_plus_infinity();
812 }
813 else
814 return _fVal <= rhs._fVal;
815 }

◆ max()

BoundedDouble SVF::BoundedDouble::max ( std::vector< BoundedDouble > & _l)
inlinestatic

Definition at line 1210 of file NumericValue.h.

1211 {
1213 for (const auto& it : _l)
1214 {
1215 if (it.is_plus_infinity())
1216 return plus_infinity();
1217 else if (!it.leq(ret))
1218 {
1219 ret = it;
1220 }
1221 }
1222 return ret;
1223 }
BoundedDouble()=default
static BoundedDouble minus_infinity()
static BoundedDouble plus_infinity()

◆ min()

BoundedDouble SVF::BoundedDouble::min ( std::vector< BoundedDouble > & _l)
inlinestatic

Definition at line 1195 of file NumericValue.h.

1196 {
1198 for (const auto& it : _l)
1199 {
1200 if (it.is_minus_infinity())
1201 return minus_infinity();
1202 else if (!it.geq(ret))
1203 {
1204 ret = it;
1205 }
1206 }
1207 return ret;
1208 }

◆ minus_infinity()

BoundedDouble SVF::BoundedDouble::minus_infinity ( )
inlinestatic

Definition at line 773 of file NumericValue.h.

774 {
775 return -std::numeric_limits<double>::infinity();
776 }

◆ operator=() [1/2]

BoundedDouble & SVF::BoundedDouble::operator= ( BoundedDouble && rhs)
inline

Definition at line 723 of file NumericValue.h.

724 {
725 _fVal = std::move(rhs._fVal);
726 return *this;
727 }

◆ operator=() [2/2]

BoundedDouble & SVF::BoundedDouble::operator= ( const BoundedDouble & rhs)
inline

Definition at line 715 of file NumericValue.h.

716 {
717 _fVal = rhs._fVal;
718 return *this;
719 }

◆ plus_infinity()

BoundedDouble SVF::BoundedDouble::plus_infinity ( )
inlinestatic

Definition at line 768 of file NumericValue.h.

769 {
770 return std::numeric_limits<double>::infinity();
771 }

◆ safeAdd()

double SVF::BoundedDouble::safeAdd ( double lhs,
double rhs )
inlinestatic

Adds two floating-point numbers safely, checking for overflow and underflow conditions.

Parameters
lhsLeft-hand side operand of the addition.
rhsRight-hand side operand of the addition.
Returns
The sum of lhs and rhs. If overflow or underflow occurs, returns positive or negative infinity.

Definition at line 888 of file NumericValue.h.

889 {
890 if ((lhs == std::numeric_limits<double>::infinity() &&
891 rhs == -std::numeric_limits<double>::infinity()) ||
892 (lhs == -std::numeric_limits<double>::infinity() &&
893 rhs == std::numeric_limits<double>::infinity()))
894 {
895 assert(false && "invalid add");
896 }
897 double res =
898 lhs + rhs; // Perform the addition and store the result in 'res'
899
900 // Check if the result is positive infinity due to overflow
901 if (res == std::numeric_limits<double>::infinity())
902 {
903 return res; // Positive overflow has occurred, return positive
904 // infinity
905 }
906
907 // Check if the result is negative infinity, which can indicate a large
908 // negative overflow
909 if (res == -std::numeric_limits<double>::infinity())
910 {
911 return res; // Negative "overflow", effectively an underflow to
912 // negative infinity
913 }
914
915 // Check for positive overflow: verify if both operands are positive and
916 // their sum exceeds the maximum double value
917 if (lhs > 0 && rhs > 0 &&
918 (std::numeric_limits<double>::max() - lhs) < rhs)
919 {
920 res = std::numeric_limits<double>::infinity(); // Set result to
921 // positive infinity to
922 // indicate overflow
923 return res;
924 }
925
926 // Check for an underflow scenario: both numbers are negative and their
927 // sum is more negative than what double can represent
928 if (lhs < 0 && rhs < 0 &&
929 (-std::numeric_limits<double>::max() - lhs) > rhs)
930 {
931 res = -std::numeric_limits<
932 double>::infinity(); // Set result to negative infinity to
933 // clarify extreme negative sum
934 return res;
935 }
936
937 // If none of the above conditions are met, return the result of the
938 // addition
939 return res;
940 }

◆ safeDiv()

double SVF::BoundedDouble::safeDiv ( double lhs,
double rhs )
inlinestatic

Safely divides one floating-point number by another, checking for division by zero and overflow.

Parameters
lhsLeft-hand side operand (numerator).
rhsRight-hand side operand (denominator).
Returns
The quotient of lhs and rhs. Returns positive or negative infinity for division by zero, or when overflow occurs.

Definition at line 1029 of file NumericValue.h.

1030 {
1031 // Check for division by zero
1032 if (doubleEqual(rhs, 0.0f))
1033 {
1034 return (lhs >= 0.0f) ? std::numeric_limits<double>::infinity()
1035 : -std::numeric_limits<double>::infinity();
1036 }
1037 double res = lhs / rhs;
1038 // Check if the result is positive infinity due to overflow
1039 if (res == std::numeric_limits<double>::infinity())
1040 {
1041 return res; // Positive overflow has occurred, return positive
1042 // infinity
1043 }
1044
1045 // Check if the result is negative infinity, which can indicate a large
1046 // negative overflow
1047 if (res == -std::numeric_limits<double>::infinity())
1048 {
1049 return res; // Negative "overflow", effectively an underflow to
1050 // negative infinity
1051 }
1052
1053 // Check for overflow when dividing small numbers
1054 if (rhs > 0 && rhs < std::numeric_limits<double>::min() &&
1055 lhs > std::numeric_limits<double>::max() * rhs)
1056 {
1057 return std::numeric_limits<double>::infinity();
1058 }
1059 if (rhs < 0 && rhs > -std::numeric_limits<double>::min() &&
1060 lhs > std::numeric_limits<double>::max() * rhs)
1061 {
1062 return -std::numeric_limits<double>::infinity();
1063 }
1064
1065 return res; // If no special cases, return the quotient
1066 }

◆ safeMul()

double SVF::BoundedDouble::safeMul ( double lhs,
double rhs )
inlinestatic

Safely multiplies two floating-point numbers, checking for overflow and underflow.

Parameters
lhsLeft-hand side operand of the multiplication.
rhsRight-hand side operand of the multiplication.
Returns
The product of lhs and rhs. If overflow or underflow occurs, returns positive or negative infinity accordingly.

Definition at line 968 of file NumericValue.h.

969 {
970 if (doubleEqual(lhs, 0.0f) || doubleEqual(rhs, 0.0f))
971 return 0.0f;
972 double res = lhs * rhs;
973 // Check if the result is positive infinity due to overflow
974 if (res == std::numeric_limits<double>::infinity())
975 {
976 return res; // Positive overflow has occurred, return positive
977 // infinity
978 }
979
980 // Check if the result is negative infinity, which can indicate a large
981 // negative overflow
982 if (res == -std::numeric_limits<double>::infinity())
983 {
984 return res; // Negative "overflow", effectively an underflow to
985 // negative infinity
986 }
987 // Check for overflow scenarios
988 if (lhs > 0 && rhs > 0 &&
989 lhs > std::numeric_limits<double>::max() / rhs)
990 {
991 return std::numeric_limits<double>::infinity();
992 }
993 if (lhs < 0 && rhs < 0 &&
994 lhs < std::numeric_limits<double>::max() / rhs)
995 {
996 return std::numeric_limits<double>::infinity();
997 }
998
999 // Check for "underflow" scenarios (negative overflow)
1000 if (lhs > 0 && rhs < 0 &&
1001 rhs < std::numeric_limits<double>::lowest() / lhs)
1002 {
1003 return -std::numeric_limits<double>::infinity();
1004 }
1005 if (lhs < 0 && rhs > 0 &&
1006 lhs < std::numeric_limits<double>::lowest() / rhs)
1007 {
1008 return -std::numeric_limits<double>::infinity();
1009 }
1010
1011 return res; // If no overflow or underflow, return the product
1012 }

◆ set_minus_infinity()

void SVF::BoundedDouble::set_minus_infinity ( )
inline

Definition at line 763 of file NumericValue.h.

764 {
765 *this = minus_infinity();
766 }

◆ set_plus_infinity()

void SVF::BoundedDouble::set_plus_infinity ( )
inline

Definition at line 758 of file NumericValue.h.

759 {
760 *this = plus_infinity();
761 }

◆ to_string()

virtual const std::string SVF::BoundedDouble::to_string ( ) const
inlinevirtual

Definition at line 1262 of file NumericValue.h.

1263 {
1264 return std::to_string(_fVal);
1265 }

◆ abs

BoundedDouble abs ( const BoundedDouble & lhs)
friend

Definition at line 1225 of file NumericValue.h.

1226 {
1227 return lhs.leq(0) ? -lhs : lhs;
1228 }

◆ eq

bool eq ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1180 of file NumericValue.h.

1181 {
1182 return doubleEqual(lhs._fVal, rhs._fVal);
1183 }

◆ ite

BoundedDouble ite ( const BoundedDouble & cond,
const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1167 of file NumericValue.h.

1169 {
1170 return cond._fVal != 0.0f ? lhs._fVal : rhs._fVal;
1171 }

◆ max

BoundedDouble max ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1190 of file NumericValue.h.

1191 {
1192 return std::max(lhs._fVal, rhs._fVal);
1193 }

◆ min

BoundedDouble min ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1185 of file NumericValue.h.

1186 {
1187 return std::min(lhs._fVal, rhs._fVal);
1188 }

◆ operator!

BoundedDouble operator! ( const BoundedDouble & lhs)
friend

Definition at line 1134 of file NumericValue.h.

1135 {
1136 return !lhs._fVal;
1137 }

◆ operator!=

bool operator!= ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 849 of file NumericValue.h.

851 {
852 return !lhs.equal(rhs);
853 }

◆ operator%

BoundedDouble operator% ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1074 of file NumericValue.h.

1076 {
1077 if (rhs.is_zero())
1078 assert(false && "divide by zero");
1079 else if (!lhs.is_infinity() && !rhs.is_infinity())
1080 return std::fmod(lhs._fVal, rhs._fVal);
1081 else if (!lhs.is_infinity() && rhs.is_infinity())
1082 return 0.0f;
1083 // TODO: not sure
1084 else if (lhs.is_infinity() && !rhs.is_infinity())
1085 return ite(rhs._fVal > 0.0f, lhs, -lhs);
1086 else
1087 // TODO: +oo/-oo L'Hôpital's rule?
1088 return eq(lhs, rhs) ? plus_infinity() : minus_infinity();
1089 abort();
1090 }
friend BoundedDouble ite(const BoundedDouble &cond, const BoundedDouble &lhs, const BoundedDouble &rhs)
friend bool eq(const BoundedDouble &lhs, const BoundedDouble &rhs)

◆ operator&

BoundedDouble operator& ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1108 of file NumericValue.h.

1110 {
1111 int lInt = std::round(lhs._fVal), rInt = std::round(rhs._fVal);
1112 return lInt & rInt;
1113 }

◆ operator&&

BoundedDouble operator&& ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1122 of file NumericValue.h.

1124 {
1125 return lhs._fVal && rhs._fVal;
1126 }

◆ operator*

BoundedDouble operator* ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1014 of file NumericValue.h.

1016 {
1017 return safeMul(lhs._fVal, rhs._fVal);
1018 }
static double safeMul(double lhs, double rhs)

◆ operator+

BoundedDouble operator+ ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 942 of file NumericValue.h.

944 {
945 return safeAdd(lhs._fVal, rhs._fVal);
946 }
static double safeAdd(double lhs, double rhs)

◆ operator- [1/2]

BoundedDouble operator- ( const BoundedDouble & lhs)
friend

Definition at line 948 of file NumericValue.h.

949 {
950 return -lhs._fVal;
951 }

◆ operator- [2/2]

BoundedDouble operator- ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 953 of file NumericValue.h.

955 {
956 return safeAdd(lhs._fVal, -rhs._fVal);
957 }

◆ operator/

BoundedDouble operator/ ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1068 of file NumericValue.h.

1070 {
1071 return safeDiv(lhs._fVal, rhs._fVal);
1072 }
static double safeDiv(double lhs, double rhs)

◆ operator<

bool operator< ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 861 of file NumericValue.h.

863 {
864 return !lhs.geq(rhs);
865 }

◆ operator<< [1/2]

BoundedDouble operator<< ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1153 of file NumericValue.h.

1155 {
1156 assert(rhs.geq(0) && "rhs should be greater or equal than 0");
1157 if (lhs.is_zero())
1158 return lhs;
1159 else if (lhs.is_infinity())
1160 return lhs;
1161 else if (rhs.is_infinity())
1162 return lhs.geq(0) ? plus_infinity() : minus_infinity();
1163 else
1164 return (s32_t)lhs.getNumeral() << (s32_t)rhs.getNumeral();
1165 }
signed s32_t
Definition GeneralType.h:68

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream & out,
const BoundedDouble & expr )
friend

Definition at line 1173 of file NumericValue.h.

1175 {
1176 out << expr._fVal;
1177 return out;
1178 }

◆ operator<=

bool operator<= ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 867 of file NumericValue.h.

869 {
870 return lhs.leq(rhs);
871 }

◆ operator==

bool operator== ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Reload operator.

Definition at line 843 of file NumericValue.h.

845 {
846 return lhs.equal(rhs);
847 }

◆ operator>

bool operator> ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 855 of file NumericValue.h.

857 {
858 return !lhs.leq(rhs);
859 }

◆ operator>=

bool operator>= ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 873 of file NumericValue.h.

875 {
876 return lhs.geq(rhs);
877 }

◆ operator>>

BoundedDouble operator>> ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1139 of file NumericValue.h.

1141 {
1142 assert(rhs.geq(0) && "rhs should be greater or equal than 0");
1143 if (lhs.is_zero())
1144 return lhs;
1145 else if (lhs.is_infinity())
1146 return lhs;
1147 else if (rhs.is_infinity())
1148 return lhs.geq(0) ? 0 : -1;
1149 else
1150 return (s32_t)lhs.getNumeral() >> (s32_t)rhs.getNumeral();
1151 }

◆ operator^

BoundedDouble operator^ ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1101 of file NumericValue.h.

1103 {
1104 int lInt = std::round(lhs._fVal), rInt = std::round(rhs._fVal);
1105 return lInt ^ rInt;
1106 }

◆ operator|

BoundedDouble operator| ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1115 of file NumericValue.h.

1117 {
1118 int lInt = std::round(lhs._fVal), rInt = std::round(rhs._fVal);
1119 return lInt | rInt;
1120 }

◆ operator||

BoundedDouble operator|| ( const BoundedDouble & lhs,
const BoundedDouble & rhs )
friend

Definition at line 1128 of file NumericValue.h.

1130 {
1131 return lhs._fVal || rhs._fVal;
1132 }

Member Data Documentation

◆ _fVal

double SVF::BoundedDouble::_fVal
protected

Definition at line 706 of file NumericValue.h.


The documentation for this class was generated from the following file: