@@ -71,6 +71,7 @@ exprt get_significand(
71
71
72
72
// / Create an expression to represent a float or double value.
73
73
// / \param f: a floating point value in double precision
74
+ // / \param float_spec: a specification for floats
74
75
// / \return an expression representing this floating point
75
76
exprt constant_float (const double f, const ieee_float_spect &float_spec)
76
77
{
@@ -97,7 +98,6 @@ exprt round_expr_to_zero(const exprt &f)
97
98
// / Note that the rounding mode is set to ROUND_TO_EVEN.
98
99
// / \param f: a floating point expression
99
100
// / \param g: a floating point expression
100
- // / \param rounding: rounding mode
101
101
// / \return An expression representing floating point multiplication.
102
102
exprt floatbv_mult (const exprt &f, const exprt &g)
103
103
{
@@ -124,8 +124,8 @@ exprt floatbv_of_int_expr(const exprt &i, const ieee_float_spect &spec)
124
124
125
125
// / Estimate the decimal exponent that should be used to represent a given
126
126
// / floating point value in decimal.
127
- // / We are looking for d such that n * 10^d = m * 2^e, so:
128
- // / d = log_10(m) + log_10(2) * e - log_10(n)
127
+ // / We are looking for \f$d\f$ such that \f$ n * 10^d = m * 2^e\f$ , so:
128
+ // / \f$ d = log_10(m) + log_10(2) * e - log_10(n)\f$
129
129
// / m -- the fraction -- should be between 1 and 2 so log_10(m)
130
130
// / in [0,log_10(2)].
131
131
// / n -- the fraction in base 10 -- should be between 1 and 10 so
@@ -169,10 +169,10 @@ exprt string_constraint_generatort::add_axioms_from_double(
169
169
}
170
170
171
171
// / Add axioms corresponding to the integer part of m, in decimal form with no
172
- // / leading zeroes, followed by '.' ('\ u002E'), followed by one or more decimal
173
- // / digits representing the fractional part of m. This specification is correct
174
- // / for inputs that do not exceed 100000 and the function is unspecified for
175
- // / other values.
172
+ // / leading zeroes, followed by ` '.'` (`'\\ u002E'` ), followed by one or more
173
+ // / decimal digits representing the fractional part of m. This specification is
174
+ // / correct for inputs that do not exceed 100000 and the function is unspecified
175
+ // / for other values.
176
176
// /
177
177
// / TODO: this specification is not correct for negative numbers and
178
178
// / double precision
@@ -219,11 +219,11 @@ exprt string_constraint_generatort::add_axioms_for_string_of_float(
219
219
220
220
// / Add axioms for representing the fractional part of a floating point starting
221
221
// / with a dot
222
+ // / \param res: string expression for the result
222
223
// / \param int_expr: an integer expression
223
224
// / \param max_size: a maximal size for the string, this includes the
224
225
// / potential minus sign and therefore should be greater than 2
225
- // / \param ref_type: a type for refined strings
226
- // / \return a string expression
226
+ // / \return code 0 on success
227
227
exprt string_constraint_generatort::add_axioms_for_fractional_part (
228
228
const array_string_exprt &res,
229
229
const exprt &int_expr,
@@ -297,20 +297,18 @@ exprt string_constraint_generatort::add_axioms_for_fractional_part(
297
297
298
298
// / Add axioms to write the float in scientific notation.
299
299
// /
300
- // / A float is represented as $f = m * 2^e$ where $0 <= m < 2$ is the
301
- // / significand and $-126 <= e <= 127$ is the exponent.
302
- // / We want an alternate representation by finding $n $ and
303
- // / $d $ such that $f=n*10^d$. We can estimate $d $ the following way:
304
- // / $d ~= log_10(f/n) ~= log_10(m) + log_10(2) * e - log_10(n)$
305
- // / $d = floor(log_10(2) * e)$
306
- // / Then $n $ can be expressed by the equation:
307
- // / $log_10(n) = log_10(m) + log_10(2) * e - d$
308
- // / $n = f / 10^d = m * 2^e / 10^d = m * 2^e / 10^(floor(log_10(2) * e))$
300
+ // / A float is represented as \f $f = m * 2^e\f $ where \f $0 <= m < 2\f $ is the
301
+ // / significand and \f $-126 <= e <= 127\f $ is the exponent.
302
+ // / We want an alternate representation by finding \f$n\f $ and
303
+ // / \f$d\f $ such that \f $f=n*10^d\f $. We can estimate \f$d\f $ the following way:
304
+ // / \f $d ~= log_10(f/n) ~= log_10(m) + log_10(2) * e - log_10(n)\f $
305
+ // / \f $d = floor(log_10(2) * e)\f $
306
+ // / Then \f$n\f $ can be expressed by the equation:
307
+ // / \f $log_10(n) = log_10(m) + log_10(2) * e - d\f $
308
+ // / \f $n = f / 10^d = m * 2^e / 10^d = m * 2^e / 10^(floor(log_10(2) * e))\f $
309
309
// / TODO: For now we only consider single precision.
310
310
// / \param res: string expression representing the float in scientific notation
311
311
// / \param f: a float expression, which is positive
312
- // / \param max_size: a maximal size for the string
313
- // / \param ref_type: a type for refined strings
314
312
// / \return a integer expression different from 0 to signal an exception
315
313
exprt string_constraint_generatort::add_axioms_from_float_scientific_notation (
316
314
const array_string_exprt &res,
@@ -476,7 +474,7 @@ exprt string_constraint_generatort::add_axioms_from_float_scientific_notation(
476
474
// / Add axioms corresponding to the scientific representation of floating point
477
475
// / values
478
476
// / \param f: a function application expression
479
- // / \return a new string expression
477
+ // / \return code 0 on succes
480
478
exprt string_constraint_generatort::add_axioms_from_float_scientific_notation (
481
479
const function_application_exprt &f)
482
480
{
0 commit comments