I am making this big program in C, which is a part of my homework. My problem is that my program is outputing x = -0.00 instead of x = 0.00. I have tried comparing like if(x==-0.00) x=fabs(x) but I've read that it won't work like that with doubles. So...

## Why is decimal more precise than double if it has a shorter range? C#

Im reading the C# in a Nutshell book and it shows this table: Im having a hard time understanding the table. It says that double takes 64 bits of space and it ranges from 10^-324 to 10^308. Decimal takes 128 bits of space BUT is also says that it ranges...

## Best way to approximate in direction to zero in C++

I have some troubles explaining clearly but it's rather simple.. I have a double named value in my C++ program and I want to Floor it if it's a positive value and Ceil if it's a negative value, the precision is given by an external variable.

## Convert double to int array

I have a double I want to convert this to a int arrayI came up with thisIt's working but I don't like this solution because I think a lot of conversions between datatypes can lead to errors. Is my code even complete or do I need to check for something...

## Java – Convert double to int array

## Getting unwanted NullPointerException in ternary operator – Why?

While executing following code, I am getting NullPointerException at lineIn earlier lines when I use null instead of getDouble() everything works and this is strange.

## Integer divisions of a number

How do I split a number into equal parts or as close to equal as possible. See example below: If I have a value of 61 that i want to distribute between two groups, it would be 30.5 and 30.5. Doubles (decimals) are no good, so in this regard the...

## How to convert primitive double array to Double array

With the Apache common math library I get back a primitive double array.I need to convert temp to a Double[][]

## why using int64_t gives wrong result while double works as expected for simple integer multiplications

here is my code :this printswhich is wrong answer but if i change integer type to double that will print 1.37847e+11 which is the correct answer,my question is why using int64_t gives me incorrect answer