Skip to main content

Questions tagged [fixed-point]

Fixed point arithmetic is done using a set number of decimal places. It can be faster and is more precise than floating-point.

4 votes
2 answers
741 views

I am implementing a fixed point type, which mostly is used to be able store numbers as multiples of some base (power of 2). Apart from that, the type should be able to replace double/float values ...
tommsch's user avatar
  • 293
0 votes
3 answers
334 views

Write and test your own double abc (char * b) function in the program, taking in the form of a string the fractional binary number of the form "1101.101" ...
xyz9's user avatar
  • 21
4 votes
0 answers
826 views

Background In many languages we have built-in data types for representing decimal floating point numbers. In .NET that's decimal, and in Java we have ...
Mark Vincze's user avatar
7 votes
2 answers
355 views

The question itself should be fairly self-explanatory. My method takes in value, max_digits, and ...
darkhorse's user avatar
  • 468
3 votes
2 answers
1k views

Am making a pure .net library with helper functions (GitHub). However I wanted to have a thousand separator for all number types and here is what I am currently doing ...
Billy Watsy's user avatar
1 vote
2 answers
228 views

I'm working on a clientside iOS app for my school that involves students purchasing things, and I wrote a String extension for formatting a ...
dropbear's user avatar
  • 225
4 votes
1 answer
212 views

I'm working on a web form that functions with numeric inputs. I have <input type="number"> input fields and with Chrome and Firefox things work nicely since ...
Hamatti's user avatar
  • 171
4 votes
4 answers
5k views

I wrote a C# program that converts decimal to string. It is not the best but it works. I'm looking for inputs from others on how ...
gmail user's user avatar
1 vote
1 answer
2k views

I have some code that is used to convert a decimal currency to an integer with precision being a function of which currency is being converted. This code is more of a "brute-force" method to do the ...
meyousikmann's user avatar
4 votes
3 answers
560 views

Background I have a list of strings containing numbers. Each string is 8 characters long. For example : ...
Luci's user avatar
  • 225
7 votes
2 answers
2k views

I am trying to create a Fixed Point Arithmetics library : I call fixed point a number which has bits reserved for decimal part. Here is the code : ...
Julien Vernay's user avatar
7 votes
2 answers
398 views

For a while now I have been working to construct a program to calculate a lot of mathematical constants. Before I explain, here's the code: Code ...
esote's user avatar
  • 3,800
3 votes
1 answer
881 views

The following code converts a number into Indian numbering system format. I know locale can also help in getting similar format but I wanted something that can work on any system because not all ...
Ashwini Chaudhary's user avatar
8 votes
3 answers
2k views

My goal is to take a uint64_t that represents a fixed-point decimal, and output a string representation of the decimal. The fixed-point representation always has ...
Thomas Johnson's user avatar
3 votes
3 answers
378 views

I have written a string number formatter. I would like to know if this can be improved and any suggestions with how it's done. The purpose of this function is to convert a double that has been ...
Sam Orozco's user avatar

15 30 50 per page