Tag Info

New answers tagged

2

First, how do you create a -0? There are two ways: (1) do a floating-point operation where the mathematical result is negative, but so close to zero that it gets rounded to zero and not to a non-zero number. That calculation will give a -0. (b) Certain operations involving zeroes: Multiply a positive zero by a negative number, or divide a positive zero by a ...


0

The reason is simpler than usual Of course there is a lot of hacks which are looking really nice and they are useful (like rounding to -0.0 or +0.0 but assume we have a representation of signed int with a minus/plus sign at the beginning (i know that is resolved by U2 binary code in integers usually but assume a less complex representation of double): 0 ...


25

You need to keep in mind that in FPU arithmetics, 0 doesn't necessarily has to mean exactly zero, but also value too small to be represented using given datatype, e.g. a = -1 / 1000000000000000000.0 a is too small to be represented correctly by float (32 bit), so it is "rounded" to -0. Now, let's say our computation continues: b = 1 / a Because a is ...


3

C# Double which conforms to IEEE 754 double a = 3.0; double b = 0.0; double c = -0.0; Console.WriteLine(a / b); Console.WriteLine(a / c); prints: Infinity -Infinity actually to explain a little... Double d = -0.0; This means something a lot closer to d= The Limit of x as x approaches 0- or The Limit of x as x approaches 0 ...


-1

Mathematics is everything to do with programming. For example, in game programming you need to use matyhs for the physics and to do more less everything. To move the player's x position in Java you would do int x = x + speed * deltaTime or int x = x - speed * deltaTime But you might say that that is basic maths so lets move onto more advanced stuff. There is ...


0

1) As you learn programming, you will come across technical jargon(i.e., algorithm). To analyse algorithm, one has to have an idea about the nature of polynomial, logarithmic and exponential functions. 2) Based on a computer science application, one has to have an idea on discrete maths and continuous maths to write meaningful solution. One can understand ...



Top 50 recent answers are included