All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages

fixed.h File Reference

ASF Sensor API fixed point data type.

This header defines a fixed-point data type and associated arithmetic operations. The `fixed`

type approximates fractional quantities using a pair of integers, designated as the mantissa and exponent, such that \( n2^{-q} \) given integer exponent *q* and integer mantissa *n*

Because exponent *q* is a power of 2 it can also be understood as the number of binary digits into *n* where the binary point is placed. And since mantissa *n* is a factor of a power of two, it is only necessary to store the mantissa and the number of fractional bits. This is also known as *Q* number format.

The mantissa is stored and operated on as a signed two's complement number, where *Q* specifies the number of fractional bits and, by implication, the location of a virtual fixed decimal point within the mantissa.

Copyright (c) 2011-2012 Atmel Corporation. All rights reserved.

`#include "fixed_t.h"`

Generated on Wed Oct 29 2014 09:15:05 for UC3 A0/A1 by 1.8.5