Questions tagged [fixed-point]

Questions about fixed-point arithmetic, done using a set number of decimal places. For the combinators used to encode recursion, use [fixpoint-combinators] instead. For the numerical method, use [fixed-point-iteration] instead. For the fixedpoint engine of Z3, use [z3-fixedpoint] instead.

Fixed point arithmetic uses a fixed radix position to do calculations, instead of a variable amount (floating point). Instead of representing numbers using the IEEE mantissa-and-exponent format, numbers are represented as integers which are scaled by a fixed amount. It can be faster and is, within its regime, more precise than floating-point.

Most questions deal with finding a suitable fixed-point library for [insert language here], as most languages lack fixed-point arithmetic in their standard libraries (although some have one natively). Also, different types of fixed point number exist based on the number of decimal points included (and thus accuracy) - see the Q format.

511 questions
2
votes
1 answer

Convert 32 bit fixed point value

In my Java application I need to interpret a 32 Bit Fixed Point value. The number format is as follows: The first 15 bits describe the places before the comma/point, the 16th bit represents the sign of the value and the following 16 bits describe…
Moonlit
  • 5,171
  • 14
  • 57
  • 95
2
votes
1 answer

.NET Decimal formats differently depending on source

I have a case which I've never seen before. In one case, where we assign a decimal value via code, e.g. the value foo.DecimalField = 200M; When I ToString() this with no formatter or culture, I get the value "200" In another case, when the same…
Roger Johansson
  • 22,764
  • 18
  • 97
  • 193
2
votes
5 answers

sprintf : fixed point, big numbers and precision loss

I need to read some numbers in a database and write them into a text file using Perl. In the table where are the numbers, the data format is defined as numeric (25,5) (it reads 25 digits, including 5 decimals). I format the numbers in my file with…
Seki
  • 11,135
  • 7
  • 46
  • 70
2
votes
2 answers

Fixed point inverse sine

Does anyone know a (preferably fast) way to calculate the sine of an angle in 4.12 fixed point? (where the result is either 32768ths of a circle or degrees) 4.12 fixed point means the number is 16 bits and is left shifted 12, so 1.0 becomes (1 <<…
user253751
  • 57,427
  • 7
  • 48
  • 90
2
votes
1 answer

NEON Fixed point coding and Fixed vs Floating point operations performance comparison

As we can see here "arm integer NEON operations cycles " and arm float NEON operations cycles ,the integer Multiply operations does not seem to have a definite advantage over the Floating point Multiplication operations. When I converted my floating…
Wolfrum
  • 63
  • 1
  • 7
2
votes
2 answers

data structures for floating point operation in fixed point processor

I need to program a fixed point processor that was used for a legacy application. New features are requested and these features need large dynamic range , most likely beyond the fixed point range even after scaling. As the processor will not be…
Shan
  • 5,054
  • 12
  • 44
  • 58
2
votes
1 answer

Limits of Ada Fixed Point Type

Reading this http://en.wikibooks.org/wiki/Ada_Programming/Types/delta has got me wondering what the limit value of delta is. For example delta 127 range 0..1_000_000; needs one byte to hold the delta value. But delta 0.0000000001 range…
user485498
2
votes
2 answers

Floating vs Fixed point numbers and performance

I'm curious on how quick floating point operations are on dedicated hardware vs fixed. With fixed point, say you have the number 555 and you want to multiply by 1.54, you'd load the values 555, 154, and 100 into registers (three clocks), multiply…
Ryan Brown
  • 1,017
  • 1
  • 13
  • 34
2
votes
4 answers

Fixed point multiplication

I need to convert a value from one unit to another according to a non constant factor. The input value range from 0 to 1073676289 and the range value range from 0 to 1155625. The conversion can be described like this: output = input * (range /…
Vandhunden
  • 426
  • 4
  • 11
2
votes
2 answers

Fixed point <-> Double precision

I need insight on signed conversion. An input to a C routine is guaranteed to lie in the range -Pi to pi. This is passed by "double" data type. Since my device lacks a FPU, I must perform math (Divide input by Pi )on the input using fixed point on a…
Raj
  • 857
  • 11
  • 26
1
vote
1 answer

fixed point fx notation and converting

I have a fx1.15 notation. The underlying integer value is 63183 (register value). Now, according to wikipedia the the complete length is 15 bits. The value does not fit inside, right? So assuming it is a fx1.16 value, how do I convert it to a human…
ashirk
  • 13
  • 5
1
vote
2 answers

Compilation optimization for iPhone : floating point or fixed point?

I'm building a library for iphone (speex, but i'm sure it will apply to a lot of other libs too) and the make script has an option to use fixed point instead of floating point. As the iphone ARM processor has the VFP extension and performs very well…
Albrecht Andrzejewski
  • 2,100
  • 1
  • 13
  • 16
1
vote
3 answers

How do i convert a fixed point number into a float?

Using Unity. I need to used fixed point to network some data deterministically. How do I convert a fixed point back into a float so that I can apply it to the objects transform? public class Fixed { private int front; private int back; …
1
vote
1 answer

How can I improve fixed-point data type utilization?

I'm trying to use the quantization for a convolutional neural network in order to reduce memory occupation going from the FP32 bit data type to Int16 one. The problem is that I'm obtaining poor results and since it's the first time that I use this…
Dresult
  • 171
  • 1
  • 11
1
vote
0 answers

How to calculate unknown values in Sine linear interpolation using quadrature look up table (LUT)?

I have generated a sine wave using a 257-point look-up table that covers only one quadrant (4th quadrant). The entries in the table are in fixed point format (Q1.15) [o,.....,-32768]. linear interpolation is used for finding unknown values in the…