@@ -146,6 +146,51 @@ FloatingPointFormula makeNumber(
146
146
147
147
FloatingPointFormula makeNaN (FloatingPointType type );
148
148
149
+ /**
150
+ * Build a formula of compatible type from a {@link FloatingPointFormula}. This method uses the
151
+ * default rounding mode.
152
+ *
153
+ * <p>Compatible formula types are all numeral types and bitvector types. It is also possible to
154
+ * cast a floating-point number into another floating-point type. We do not support casting from
155
+ * boolean or array types. We try to keep an exact representation, however fall back to rounding
156
+ * if needed.
157
+ *
158
+ * @param source the source formula of floating-point type
159
+ * @param targetType the type of the resulting formula
160
+ * @throws IllegalArgumentException if an incompatible type is used, e.g. a {@link
161
+ * FloatingPointFormula} cannot be cast to {@link BooleanFormula}.
162
+ */
163
+ @ Deprecated (
164
+ forRemoval = true ,
165
+ since = "2022.06, because of missing sign-bit for bitvector conversion" )
166
+ default <T extends Formula > T castTo (FloatingPointFormula source , FormulaType <T > targetType ) {
167
+ return castTo (source , true , targetType );
168
+ }
169
+
170
+ /**
171
+ * Build a formula of compatible type from a {@link FloatingPointFormula}.
172
+ *
173
+ * <p>Compatible formula types are all numeral types and bitvector types. It is also possible to
174
+ * cast a floating-point number into another floating-point type. We do not support casting from
175
+ * boolean or array types. We try to keep an exact representation, however fall back to rounding
176
+ * if needed.
177
+ *
178
+ * @param source the source formula of floating-point type
179
+ * @param targetType the type of the resulting formula
180
+ * @param pFloatingPointRoundingMode if rounding is needed, we apply the rounding mode.
181
+ * @throws IllegalArgumentException if an incompatible type is used, e.g. a {@link
182
+ * FloatingPointFormula} cannot be cast to {@link BooleanFormula}.
183
+ */
184
+ @ Deprecated (
185
+ forRemoval = true ,
186
+ since = "2022.06, because of missing sign-bit for bitvector conversion" )
187
+ default <T extends Formula > T castTo (
188
+ FloatingPointFormula source ,
189
+ FormulaType <T > targetType ,
190
+ FloatingPointRoundingMode pFloatingPointRoundingMode ) {
191
+ return castTo (source , true , targetType , pFloatingPointRoundingMode );
192
+ }
193
+
149
194
/**
150
195
* Build a formula of compatible type from a {@link FloatingPointFormula}. This method uses the
151
196
* default rounding mode.
0 commit comments