Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
5edc13af
Commit
5edc13af
authored
1 month ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Eva] Fc_float: always rounds the widened float to the given precision.
parent
59e32dcd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/kernel_services/abstract_interp/fc_float.ml
+8
-6
8 additions, 6 deletions
src/kernel_services/abstract_interp/fc_float.ml
with
8 additions
and
6 deletions
src/kernel_services/abstract_interp/fc_float.ml
+
8
−
6
View file @
5edc13af
...
...
@@ -120,15 +120,17 @@ let prev_float prec f =
let
widen_up
?
(
hint
=
Datatype
.
Float
.
Set
.
empty
)
prec
f
=
let
is_upper
e
=
total_compare
e
f
>=
0
in
match
Datatype
.
Float
.
Set
.
find_first_opt
is_upper
hint
with
|
None
->
if
f
<=
max_float
then
max_float
else
infinity
|
Some
result
->
round_to_precision
Up
prec
result
let
threshold_opt
=
Datatype
.
Float
.
Set
.
find_first_opt
is_upper
hint
in
let
default
=
if
f
<=
max_float
then
max_float
else
infinity
in
let
result
=
Option
.
value
~
default
threshold_opt
in
round_to_precision
Up
prec
result
let
widen_down
?
(
hint
=
Datatype
.
Float
.
Set
.
empty
)
prec
f
=
let
is_lower
e
=
total_compare
e
f
<=
0
in
match
Datatype
.
Float
.
Set
.
find_last_opt
is_lower
hint
with
|
None
->
if
f
>=
-.
max_float
then
-.
max_float
else
neg_infinity
|
Some
result
->
round_to_precision
Down
prec
result
let
threshold_opt
=
Datatype
.
Float
.
Set
.
find_last_opt
is_lower
hint
in
let
default
=
if
f
>=
(
-.
max_float
)
then
-.
max_float
else
neg_infinity
in
let
result
=
Option
.
value
~
default
threshold_opt
in
round_to_precision
Down
prec
result
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment