60 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
1
answer
200
views
How to compute the angles of a triangle accurately given squared edge lengths?
Given the squared edge-lengths of a triangle as a, b, c > 0, how can we accurately compute the interior angles?
Kahan's oft cited method which carefully rearranges parentheses assumes (unsquared) ...
5
votes
3
answers
902
views
on nvidia gpu, does __hmul use fp32 core?
Refer to https://developer.nvidia.com/blog/nvidia-hopper-architecture-in-depth/
, each SM has three type cuda cores, e.g int32 core/fp32 core/fp64 core. If the datatype is int32/fp32/fp64, I think the ...
0
votes
1
answer
566
views
Difference between machine precision and underflow
I don't get the difference between machine precision and underflow. Take for example the single precision system: there the machine precision is 10^-7 while the underflow is 1.18 *10^-38.
That means ...
0
votes
1
answer
435
views
Why does summing numbers in ascending or descending sorting change the result?
I searched the answer to this question a lot, and I found that, in my case, it's the opposite.
I am trying to sum single precision float numbers in descending and ascending order to figure it out ...
0
votes
1
answer
212
views
What is the equivalent of Matlab/Octave single type cast function in Python
I have received the data from a socket. In Matlab, this data is converted into single precision by the following function
data_cal_rx = typecast(data_tcp2, "single");
Now I would like to ...
2
votes
2
answers
1k
views
Double vs Float vs _Float16 (Running Time)
I have a simple question in C language. I am implementing a half-precision software using _Float16 in C (My mac is based on ARM), but running time is not quite faster than single or double-precision ...
2
votes
1
answer
137
views
What is the application of single-precision format in the following MATLAB code?
I am imitating the following MATLAB code. actually, this code implement the eigenface method for face recognition.
%You are free to use, modify or distribute this code
loaded_Image=load_img();
...
0
votes
1
answer
1k
views
Why does the floating point representation of 0.1 end in 1?
I've been writing a decimal to single-precision IEEE754 floating-point converter, and I found a few discrepancies with numbers like 0.1 and 0.2
Let's take 0.1, the first step would be converting it ...
3
votes
1
answer
186
views
Does accessing the 4 bytes of a float break C++ aliasing rules
I need to read the binary content of a file and turn the extracted bytes into single precision floating point numbers. How to do this has already been asked here. That question does have proper ...
0
votes
1
answer
521
views
Trouble grasping "error due to conversion" in single-precision IEEE-754 when attempting to represent 2^(-23)
Let me preface the question by saying that I understand why values such as 0.1, 3.14, 0.2, and other values not composable of combinations of powers of two are ultimately unrepresentable by IEEE-754 ...
4
votes
4
answers
2k
views
How do I print the exact value stored in a float?
If I assign the value 0.1 to a float:
float f = 0.1;
The actual value stored in memory is not an exact representation of 0.1, because 0.1 is not a number that can be exactly represented in single-...
5
votes
2
answers
2k
views
Single precision argument reduction for trigonometric functions in C
I have implemented some approximations for trigonometric functions (sin,cos,arctan) computed with single precision (32 bit floating point) in C. They are accurate to about +/- 2 ulp.
My target device ...
4
votes
3
answers
1k
views
Approximating cosine on [0,pi] using only single precision floating point
i'm currently working on an approximation of the cosine. Since the final target device is a self-developement working with 32 bit floating point ALU / LU and there is a specialized compiler for C, I ...
0
votes
1
answer
3k
views
Arduino convert float to hex IEEE754 Single precision 32-bit
I would like to convert float values to IEEE754 Single precision 32-bit Hex values in the following site on Arduino.
https://www.binaryconvert.com/result_float.html?decimal=051046049048
float f = ...
-1
votes
3
answers
3k
views
Byte[] to float conversion
Float b = 0.995;
Byte[] a = Bitconverter.GetBytes(b);
Now my byte[] values are 82 184 126 63 .i.e.,
a[0] = 82, a[1] =184, a[2] = 126, and a[3] = 63.
I want to revert back above byte to float.So,I ...