Questions tagged as 'double'

1
answer

How to limit the decimal places of the scanf of a double variable?

The exercise asks that the readings of double variables be limited to only one decimal place each. I tried to put "%.1lf" in scanf , just like we used in printf , but it did not work. How could I solve this? int ma...
asked by 12.08.2016 / 05:55
2
answers

What kind of data (double, float) should I use when representing a temperature?

My question is regarding the use of Double and Float in Java exercises when having to declare a temperature (Celsius scale). Which one should I use in this case? I declare as Double , but the teacher correcting the exercis...
asked by 07.09.2018 / 21:00
1
answer

How do you know if the sum of two double's will give greater than the limit of a double?

Is there any way to know if a sum between two values in the format double will exceed the limit of the variable double ? Example with integer: 2147483648 + 1. In this case it goes beyond the limit of an integer, I do not know if...
asked by 19.10.2016 / 10:40
1
answer

How to convert string to double without rounding error?

Because the following command: Convert.ToDouble("199998,99") Results in:    199998.98999999999 Already the command: Convert.ToDouble("199998,98") Results in:    199998.98000000001 ?     
asked by 31.07.2015 / 14:47
3
answers

Use Double in compareTo method

I have a question. I have several methods of comparison, however, one of the attributes used to make the comparison is double. There is an error:    Can not invoke compareTo (double) on the primitive type double I tried converting t...
asked by 26.02.2016 / 18:19
1
answer

Error rounding BigDecimal

I'm doing a calculation with two methods, but since the attributes are of type double , I'm using BigDecimal to perform the operation and after that convert to two decimal places only. I'm having difficulty converting, I've tried...
asked by 17.11.2015 / 03:49
1
answer

Is it possible to use DOUBLE data type on 32-bit systems?

The DOUBLE data type is a 64-bit floating point, but can it be used on 32-bit systems without any problems?     
asked by 22.08.2017 / 19:15
2
answers

In PHP, is there a difference between Double and Float?

In some programming languages, Float and Double, although similar, are not the same thing. But apparently in PHP there is no difference between these two types. Is there any special reason for this? Why does Cast Double and Float result in th...
asked by 05.08.2017 / 19:28
2
answers

Function calculates to some extent and for

I have a double variable making an account but it reaches a limit [in my case 1.367879] and it does not increase any more. The code is running normally, the problem is the result that is no more than 1.367879 #include <stdio.h>...
asked by 31.05.2016 / 02:30
1
answer

How to convert string to double without rounding error?

Because the following command: Convert.ToDouble("199998,99") Results in:    199998.98999999999 Already the command: Convert.ToDouble("199998,98") Results in:    199998.98000000001 ?     
asked by 31.07.2015 / 14:47