All Questions
Tagged with fixed-point java
11 questions
13
votes
1
answer
986
views
BigDecimal.add strange behavior
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 still ...
4
votes
1
answer
351
views
Fixed Point Perlin Noise returns sum of input points as output
I have taken the fixed-point perlin-noise implementation from: http://mrl.nyu.edu/~perlin/noise/INoise.java and modified it slightly so it compiles under c#. In this version 1.0 is represented by 2^16....
3
votes
1
answer
2k
views
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 ...
0
votes
0
answers
66
views
Approximate logarithm of BigInteger [duplicate]
I am looking for a fast way to approximate the logarithm base 2 of a BigInteger. Speed and support for large numbers are more important than exact results. My current suggestion is:
return BigInteger....
1
vote
5
answers
1k
views
Reading 10-bit fixed-point float
I have a binary file that contains 10-bit fixed point values that I need to convert to Java float. I'm almost certain that the "format" is x.xxxxxxxxx, where x is a bit. And I do think I understand ...
3
votes
2
answers
1k
views
Square root of s15.16 fixed point number in Java
I want to write a function to calculate the square root of a s15.16 fixed point number. I know its a signed number with 15 digit int and 16 digit fraction. Is there anyway to do it without any ...
0
votes
2
answers
428
views
Java fixed point arithmetic using byte
I have some values that belong in [-1,1]. I don't need a lot of accuracy but I will need a LOT of those values. Now I'm more of a hardware guy so the solution came to me effortlessly: use fixed point ...
8
votes
4
answers
21k
views
fixed point arithmetics in java with fast performance
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 percentages....
1
vote
2
answers
5k
views
Fixed Point Numbers
I am stuck on a project in my intro to Java class.
We have to create a code that will convert a number to a Fixed Point Number. I've got that part okay, but where I am stuck is in the mathematics ...
1
vote
1
answer
209
views
What happends when you convert floating point numbers to fixed point numbers in java (java me specifically)
I want my java me program to run as efficiently as possible. my goal is to make a ray cast and want to know the best way to traverse voxels. I have heard that conversion and comparison of floating ...
1
vote
1
answer
188
views
reverse formula conversion
I have a formula which calculate position for Y, here it is:
double y = ...;
double minX = ..;
double scaleY = ..;
int MAX_COORD = (1 << 16) - 1;
int sy = ~(int)((y - minY) / scaleY * MAX_COORD)...