Справочник Пользователя для AMD 250

Скачать
Страница из 384
Chapter 2
C and C++ Source-Level Optimizations
9
Software Optimization Guide for AMD64 Processors
25112
Rev. 3.06
September 2005
2.1
Declarations of Floating-Point Values
Optimization
When working with single precision (
float
) values:
Use the 
f
 or 
F
 suffix (for example, 
3.14f
) to specify a constant value of type 
float
.
Use function prototypes for all functions that accept arguments of type 
float
.
Application
This optimization applies to:
32-bit software
64-bit software
Rationale
C and C++ compilers treat floating-point constants and arguments as double precision (
double
unless you specify otherwise. However, single precision floating-point values occupy half the 
memory space as double precision values and can often provide the precision necessary for a given 
computational problem.