Good I wanted to ask how, after having carried out operations with real numbers, for example 100 - 1.5 = 98.5;
How could I be left alone with 98?
Good I wanted to ask how, after having carried out operations with real numbers, for example 100 - 1.5 = 98.5;
How could I be left alone with 98?
The easy way is to use a rounding function.
In language C, you must include the library math.h
and the syntax is round(x)
You could take the value and make a split by point in the first position you will have the 98 and in the second the 5.
Another option is to convert the result to an integer:
Example: In java
int valor1=100;
Double valor2 =1.5;
int valor=(int) (valor1-valor2);
System.out.println(valor);
Result: 98