fixed-point Questions

7

Solved

I know it's really stupid question, but I don't know how to do this in bash: 20 / 30 * 100 It should be 66.67 but expr is saying 0, because it doesn't support float. What command in Linux can re...
Carmencita asked 10/8, 2009 at 9:48

3

Is there any compile-time library (template metaprogramming) for arbitrary-precision arithmetic in C++? I need this to help with fixed-point arithmetic and binary scaling in my program for A...

4

Solved

How to convert a "32-bit signed fixed-point number (16.16)" to a float? Is (fixed >> 16) + (fixed & 0xffff) / 65536.0 ok? What about -2.5? And -0.5? Or is fixed / 65536.0 the right way?...
Bradski asked 26/12, 2011 at 20:4

2

Solved

Currently I am trying to solve a problem, where I am supposed to print the answer upto two decimal points without rounding off. I have used the below code for this purpose import math a=1.175 #valu...
Zymo asked 27/1, 2022 at 17:5

0

I found a fast binary logarithm algorithm for fixed points in an answer to this question: Fast fixed point pow, log, exp and sqrt, based on an algorithm by Clay S. Turner. Is it possible to "revers...
Grievance asked 28/4, 2020 at 2:4

4

Solved

After reading quite a bit about fixed-point arithmetic I think I can say I've understood the basics, unfortunately I don't know yet how to convert routines that use sin/cos/sqrt or any other fp fun...
Recitativo asked 3/8, 2019 at 0:36

3

I'm trying to write a program that calculates decimal digits of π to 1000 digits or more. To practice low-level programming for fun, the final program will be written in assembly, on a 8-bit CPU t...

2

Solved

In fixed point math I use a lot of 16bit signals and perform multiplication with 32bit intermediate results. For example: int16_t a = 16384; //-1.0q14 or 1.0*2^14 int16_t b = -24576; // -1.4q14 or...
Eductive asked 6/6, 2013 at 15:51

3

Solved

I am looking for the best inverse square root algorithm for fixed point 16.16 numbers. The code below is what I have so far(but basically it takes the square root and divides by the original number...
Connotation asked 8/6, 2011 at 23:23

1

Solved

I'v already implemented fixed-point log2 function using lookup table and low-order polynomial approximation but not quite happy with accuracy across the entire 32-bit fixed-point range [-1,+1). The...
Scrummage asked 13/2, 2019 at 1:24

4

Solved

I am trying to create an application that stores stock prices with high precision. Currently I am using a double to do so. To save up on memory can I use any other data type? I know this has someth...
Deterrence asked 8/4, 2012 at 23:48

1

Solved

How can I implement 2^x fixed-point arithmetic s5.26 and input values is in range [-31.9, 31.9] using the minimax polynomial approximation for exp2() How to generate the polynomial using Sollya Too...
Weir asked 12/12, 2018 at 5:52

4

Solved

I need to represent some numbers in Java with perfect precision and fixed number of decimal points after decimal point; after that decimal point, I don't care. (More concretely - money and percenta...
Moxley asked 11/8, 2012 at 17:54

1

std::numeric_limits provides 2 constants that are mutually exclusive: is_integer : "true for all integer arithmetic types T" is_exact: "true for all arithmetic types T that use exact representati...
Proclitic asked 12/1, 2018 at 13:29

2

Solved

Just some silly musings, but if computers were able to efficiently calculate 256 bit arithmetic, say if they had a 256 bit architecture, I reckon we'd be able to do away with floating point. I also...
Guillermoguilloche asked 9/5, 2016 at 15:27

2

I am working on a fixed-point platform (floating-point arithmetic not supported). I represent any rational number q as the floor value of q * (1 << precision). I need an efficient method for ...
Greyso asked 3/8, 2017 at 22:29

7

Solved

I want to store 3.50 into a mysql table. I have a float that I store it in, but it stores as 3.5, not 3.50. How can I get it to have the trailing zero?
Battement asked 12/2, 2010 at 11:4

1

Solved

I have the following method to multiply two 32 bit numbers in fixed point 19.13 format. But I think there is a problem with this method: 1.5f is rounded up to 2.0f, while -1.5f is rounded up to -1...
Mitinger asked 21/2, 2017 at 19:32

2

Solved

This is (AFAIK) a specific question within this general topic. Here's the situation: I have an embedded system (a video game console) based on a 32-bit RISC microcontroller (a variant of NEC's V8...

1

For a university course in numerical analysis we are transitioning from Maple to a combination of Numpy and Sympy for various illustrations of the course material. This is because the students alre...

2

Solved

I am developing some code that can get its data from the HW in floating or fixed point. Currently we get that as floating point. The low layer APIs are all in fixed point. So we must pass data bac...
Metrist asked 24/11, 2016 at 8:8

1

Solved

Method BigDecimal.add takes a long time when one argument has a big exponent (9 digits), and the second has an exponent with the different length. I've waited for more than 5 minutes, and it was st...
Crumple asked 8/11, 2016 at 12:57

2

Solved

I am struggling with how to implement arithmetic on fixed-point numbers of different precision. I have read the paper by R. Yates, but I'm still lost. In what follows, I use Yates's notation, in wh...
Earpiece asked 27/6, 2016 at 13:56

1

Solved

Currently, I am using a small lookup table and linear interpolation which is quite fast and also accurate enough (max error is less than 0.001). However I was wondering if there is an approximation...
Monosome asked 11/4, 2016 at 13:38

1

Solved

so currently I'm helping develop a programming language, and we've reached the point where we have to implement a fixed point type using C++ as our backbone language to write this in. I am able to ...
Melentha asked 25/2, 2016 at 20:20

© 2022 - 2025 — McMap. All rights reserved.