Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

General Topics > Single-Precision Floating-Point Constants

Single-Precision Floating-Point Constants

Darryl Gove, July 19, 2007

The C standard specifies that by default, floating-point constants should be held as double precision values. Calculations where one variable is single precision and one variable is double precision need to be computed as double precision. So, it's very easy to have code which works entirely on single precision variables but ends up with lots of conversion between single and double precision because the constants are not specified as single precision. An example of this is shown in the next code snippet.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint