# Why is there no better representation for floating points than sign and magnitude?

Filed under:
|
|
|
##### float

We have 2's complement for integers that allows us to perform operations without worrying about the sign. That is a big help at the implementation level.

Similarly we have so many floating point operations and yet we rely on sign and magnitude. What is the reason?

Why can't a 2's complement like system work for floats?

© Stack Overflow or respective owner

• #### Comparing floating point values

as seen on Stack Overflow - Search for 'Stack Overflow'
I just read a statement about the floating point value comparison Floating point values shall not be compared using either the == or != operators. Most floating point values have no exact binary representation and have a limited precision. If so what is the best method for comparing two floating… >>> More

• #### understanding floating point variables

as seen on Stack Overflow - Search for 'Stack Overflow'
There is some problem, i can't understand anyway. look at this code please <script type="text/javascript"> function math(x) { var y; y = x*10; alert(y); } </script> <input type="button" onclick="math(0.011)"> What must be alerted after i click on button? i think 0.11… >>> More

• #### floating point hex octal binary

as seen on Stack Overflow - Search for 'Stack Overflow'
Hi, I am working on a calculator that allows you to perform calculations past the decimal point in octal, hexadecimal, binary, and of course decimal. I am having trouble though finding a way to convert floating point decimal numbers to floating point hexadecimal, octal, binary and vice versa. The… >>> More

• #### What is a Bias Value of Floating Point Numbers?

as seen on Stack Overflow - Search for 'Stack Overflow'
In learning how floating point numbers are represented in computers I have come across the term "bias value" that I do not quite understand. The bias value in floating point numbers has to do with the negative and positiveness of the exponent part of a floating point number. The bias value of a… >>> More

• #### Why are floating point values so prolific?

as seen on Stack Overflow - Search for 'Stack Overflow'
So, title says it all. Why are floating point values so prolific in computer programming. Due to problems like rounding errors, and not being able to even accurately represent numbers such as 0.1, I really can't see how they got as far as they did. I understand that the computation is faster… >>> More

• #### Using delegates in C# (Part 2)

as seen on ASP.net Weblogs - Search for 'ASP.net Weblogs'
Part 1 of this post can be read here. We are now about to see the different syntaxes for invoking a delegate and some c# syntactic sugar which allows you to code faster. We have the following console application. 1: public delegate double Operation(double x, double y); 2:  3: public… >>> More

• #### How to rotate a set of points on z = 0 plane in 3-D, preserving pairwise distances?

as seen on Game Development - Search for 'Game Development'
I have a set of points double n[] on the plane z = 0. And I have another set of points double[] m on the plane ax + by + cz + d = 0. Length of n is equal to length of m. Also, euclidean distance between n[i] and n[j] is equal to euclidean distance between m[i] and m[j]. I want to rotate n[] in 3-D… >>> More

• #### dividing double by double gives weird results - Java

as seen on Stack Overflow - Search for 'Stack Overflow'
Hi, I am trying to do the following 33.33333333333333/100.0 to get 0.333333333333333 however when I run System.out.println(33.33333333333333/100.0); I get 0.33333333333333326 as the output, similarly when I run System.out.println(33.33333333333333/1000.0); I get 0.033333333333333326 as the output… >>> More

• #### C# (4): double minus double giving precision problems

as seen on Stack Overflow - Search for 'Stack Overflow'
I have come across a precision issue with double in .NET I thought this only applied to floats but now I see that double is a float. double test = 278.97 - 90.46; Debug.WriteLine(test) //188.51000000000005 //correct answer is 188.51 What is the correct way to handle this? Round? Lop off the unneeded… >>> More

• #### Is there a Math.atan2 substitute for j2ME? Blackberry development

as seen on Stack Overflow - Search for 'Stack Overflow'
I have a wide variety of locations stored in my persistent object that contain latitudes and longitudes in double(43.7389, 7.42577) format. I need to be able to grab the user's latitude and longitude and select all items within, say 1 mile. Walking distance. I have done this in PHP so I snagged my… >>> More