I am using asin to calculate the angle. The code is as below :
double FindAngle(const double theValue)
{
return asin(theValue);
}
FindAngle returns a -0.0 (signed zero), when the argument theValue = -0.0. Now, how do i get rid of the minus sign from the return value.
...
~ Please forgive me -
I had a previous post called IEEE - 754 - find signbit, exponent, frac, normalized, etc..
However, i had not registered my nic and i cant edit it. ( so the post is basically dead to me) Can someone delete it? My question is unanswered also.
So i am posting this with different code.
i still need lots of help...
Im having a trouble with the flex calculation, im trying to transform a pixel value to mm and reversing it.
Starting out with 69.8:
Calculating MM to pixel from: 69.8 mm
69.8*300 = 20940
20940 / 2.54 = 8244.094488188975
8244.094488188975 / 10 = 824.4094488188975
And calculating back:
Calculating pixel to MM from: 824.4094488188975
8...
I have a stream of data which consists of 64-bit IEEE standard 754 floating point numbers. How would I read these as doubles in using C#? Is there a way to convert a long/ulong into a double?
...
How do you explain floating point inaccuracy to fresh programmers and laymen who still think computers are infinitely wise and accurate?
Do you have a favourite example or anecdote which seems to get the idea across much better than an precise, but dry, explanation?
How is this taught in Computer Science classes?
...
I have some inputs on my site representing floating point numbers with up to ten precision digits (in decimal). At some point, in the client side validation code, I need to compare a couple of those values to see if they are equal or not, and here, as you would expect, the intrinsics of IEEE754 make that simple check fails with things li...
I have the following object :
class Repeat{
private long startIndex;
private long endIndex;
private int length;
private float repetitions;
private float period;
private int errors;
private float percentOverlap;
public void setPercentOverlap(float percentOverlap) {
this.percentOverlap = percentOve...
I am coding an SNMP Agent. I need to send values that have a decimal point to an SNMP Manager.
I have a couple options:
Truncate the number.
Multiply by a constant.
Ask Stackoverflow.
If I truncate the number I lose a lot of information that I need.
If I multiply by a constant, then the manager will display strange units that the ...
In Java, (Number/0) throws an ArithematicException while (Number/0.0) = Infinity.
Why is it so.?
...
If a Long Integer and a float both take 4 bytes to store in memory then why are their ranges different?
...
The documentation for java.lang.Double.NaN says that it is
A constant holding a Not-a-Number (NaN) value of type double. It is equivalent to the value returned by Double.longBitsToDouble(0x7ff8000000000000L).
This seems to imply there are others. If so, how do I get hold of them, and can this be done portably?
To be clear, I woul...
What I'm doing
I have a scene which algorithmically draws a prism with a hexagonal cross-section and n layers of such prisms surrounding the center one, such that all the prisms together make a larger hexagon shape.
Now, each row of prisms is displaced from the next by a multiple of sqrt(3)/2 (because the dimensions of one prism are <...
A user of my program has reported problems reading a settings file written by my program. I looked at the settings file in question and instead of decimal points using the period "." it uses commas ",".
I'm assuming this is to do with locales?
The file i/o is using fprintf and mpfr_out_str for file output and getline combined with ato...
I'm trying to write a function in the D programming language to replace the calls to C's strtold. (Rationale: To use strtold from D, you have to convert D strings to C strings, which is inefficient. Also, strtold can't be executed at compile time.) I've come up with an implementation that mostly works, but I seem to lose some precisi...
Hi,
I am looking for a reference implementation of IEEE-754 operations. Is there such a thing?
...
I'm developing program for Cortex-M3. It doesn't have floating point coprocessor. Standard C library can emulate floating point operations, but I don't use it due to its size.
Is there any good and free c library, which can emulate floating point arithmetics, targeted on ARM processors?
Currently, when I use floating point operators I h...
I am just curious to know what happens behind the scene to convert a double to int, say int(5666.1) ? Is that going to be more expensive than a static_cast of a child class to parent? Since the representation of the int and double are fundamentally different is there going to be temporaries created during the process and expensive too.
...
Hi All,
I've managed to create a simple mandelbrot explorer using Open Gl, and the CGFX SDK provided by NVidia. It works well, but is currently float based, and therefore doesn't have much "depth" -- As the distance from the lowest complex number to the largest becomes smaller, the precision is lost, and the resultant image is "pixelate...
Possible Duplicate:
Converting float or negative integer to hexadecimal in Borland Delphi
Is there a function i can use to convert a floating point value to a hexadecimal value and back?
...
Hi,
I have met several cases where people computing reciprocal of a number with very small absolute value. They say the result should be upper bounded, since the reciprocal is very big.
(1) I wonder about the reason why is that?
e.g. in page 18 of this paper http://www-stat.stanford.edu/~tibs/ftp/boost.ps, the first paragraph, the re...