Floating Point in Scilab


This document is a small introduction to floating point numbers in Scilab. In the first part, we describe the theory of floating point numbers. We present the definition of a floating point system and of a floating point number. Then we present various representation of floating point numbers, including the sign-significand representation. We present the extreme floating point of a given system and compute the spacing between floating point numbers. Finally, we present the rounding error of representation of floats. In the second part, we present floating point numbers in Scilab. We present the IEEE doubles used in Scilab and explain why 0.1 is rounded with binary floats. We show some examples of lost properties of arithmetic and present overflow and gradual underflow in Scilab. Then we present the infinity and Nan numbers in Scilab and explore the signed zeros. Many examples are provided throughout this document, which ends with a set of exercizes, with their answers.


Copyright (C) 2008 - 2011 - Michael Baudin


This document is released under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported License :


Contribute to this document on our Forge