Skip to Content
GPGPU Programming for Games and Science
book

GPGPU Programming for Games and Science

by David H. Eberly
August 2014
Intermediate to advanced
469 pages
16h 30m
English
A K Peters/CRC Press
Content preview from GPGPU Programming for Games and Science
CPU Computing 45
// x = quiet NaN
}
else
{
// x = signaling NaN
}
// p a y l o a d = t & NAN
PAYLOAD MASK
}
}
LISTING 2.11: The general decoding of floating-point numbers.
The pseudocode that extracts the sign, biased exponent, and trailing sig-
nificand may be encapsulated, as shown in Listing 2.12. The combination of
parts into a number may also be encapsulated. There is no reason to shift the
sign bit into the lowest-order bit.
void GetEncoding ( binaryN x , UInteger& sign , UInteger& biased ,
UInteger& tr ai lin g )
{
sign = (x . encoding & SIGN
MASK ) ;
b i a s e d = ( x . e n c o d i n g & BIASED
EXPONE NT MASK) >> NUM TRAILING BITS ;
t r a i l i n g = ( x .
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Graphics Gems V (IBM Version)

Graphics Gems V (IBM Version)

Alan W. Paeth
GPU Pro 6

GPU Pro 6

Wolfgang Engel

Publisher Resources

ISBN: 9781466595354