Blog

Tag Archives: floating-point

Just a few more digits, please
Pascal Cuoq on 18 November 2011

Introduction: of Spivak pronouns In this post, I really let fly the Spivak pronouns. They are not used for the first time in this blog or in documentation but they are abused here. I have no serious justification for this sudden peak. I have a couple of unserious ones: I...

Read More

Analyzing single-precision floating-point constants
Pascal Cuoq on 14 November 2011

The previous post on this blog points out how subtle just floating-point constants can be. In a previous previous post exactly one year ago I was already alluding to these difficulties in the context of Frama-C's front-end. Programming a code analyzer that can answer question 5 How should the program...

Read More

Floating-point quiz
Pascal Cuoq on 8 November 2011

Here is a little quiz you can use to test your C floating-point expertise. I have tried to write the examples below so that the results do not depend too much on the platform and compiler. This is theoretically impossible since C99 does not mandate IEEE 754 floating-point semantics, but...

Read More

A portable OCaml function to print floats
Pascal Cuoq on 29 October 2011

For printing the results of automated Frama-C tests, we need printing functions with the following properties: they should print all the information available (doing otherwise might mask an existing bug); they should produce results readable enough for a person to validate the result of each test once; and their output...

Read More

Probably safe donut
Pascal Cuoq on 17 September 2011

Introduction In the first post in the obfuscated animated donut series my colleague Anne pointed out that: The alarm about : assert \valid(". -~:;=!*#$@"+tmp_7); seems strange because the analysis tells us that tmp_7 ∈ [0..40] at this point... How can this be valid ? It is only safe to use...

Read More