1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<title>fx64 Type Macros</title> 9<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">fx64 Type Macros <img src="../image/NTR.gif"align="middle"><img src="../image/TWL.gif" align="middle"></h1> 15<h2>Description</h2> 16<TABLE border="0" width="100%"> 17 <TBODY> 18 <TR> 19 <TD width="154">FX64_SHIFT</TD> 20 <TD width="438">Defines the shift number (12) for <CODE>fx64</CODE> types.</TD> 21 </TR> 22 <TR> 23 <TD width="154">FX64_INT_SIZE</TD> 24 <TD width="438">Defines the bit width of the integer portion (51) for <CODE>fx64</CODE> types.</TD> 25 </TR> 26 <TR> 27 <TD width="154">FX64_DEC_SIZE</TD> 28 <TD width="438">Defines the bit width for the decimal portion (12) for <CODE>fx64</CODE> types.</TD> 29 </TR> 30 <TR> 31 <TD width="154">FX64_INT_MASK</TD> 32 <TD width="438">Defines the mask for the integer portion of <CODE>fx64</CODE> types.</TD> 33 </TR> 34 <TR> 35 <TD width="154">FX64_DEC_MASK</TD> 36 <TD width="438">Defines the mask (<CODE>0x0fff</CODE>) for the decimal portion of <CODE>fx64</CODE> types.</TD> 37 </TR> 38 <TR> 39 <TD width="154">FX64_SIGN_MASK</TD> 40 <TD width="438">Defines the mask for the sign portion of <CODE>fx64</CODE> types.</TD> 41 </TR> 42 <TR> 43 <TD width="154">FX64_MAX</TD> 44 <TD width="438">Defines the maximum value that can be obtained with <CODE>fx64</CODE> types.</TD> 45 </TR> 46 <TR> 47 <TD width="154">FX64_MIN</TD> 48 <TD width="438">Defines the minimum value that can be obtained with <CODE>fx64</CODE> types.</TD> 49 </TR> 50 </TBODY> 51</TABLE> 52<H2>Macro Definitions</H2> 53<PRE>#define FX64_SHIFT 12 54#define FX64_INT_SIZE 51 55#define FX64_DEC_SIZE 12 56 57#define FX64_INT_MASK ((fx64)0x7ffffffffffff000) 58#define FX64_DEC_MASK ((fx64)0x0000000000000fff) 59#define FX64_SIGN_MASK ((fx64)0x8000000000000000) 60 61#define FX64_MAX ((fx64)0x7fffffffffffffff) 62#define FX64_MIN ((fx64)0x8000000000000000) 63#define FX_FX64_TO_F32(x) ((f32)((x) / (f32)(1 << FX64_SHIFT))) 64#define FX_F32_TO_FX64(x) ((fx64)(((x) > 0) ? \ 65 ((x) * (1 << FX32_SHIFT) + 0.5f ) : \ 66 ((x) * (1 << FX32_SHIFT) - 0.5f ))) 67 68#define FX64_CONST(x) FX_F32_TO_FX64(x) 69</CODE></PRE> 70<H2>Revision History</H2> 71<P>2004/02/25 Initial version.</P> 72<hr><p>CONFIDENTIAL</p></body> 73</html> 74