Questions tagged as 'ponto-flutuante'

1
answer

How to remove value after floating point

I have the code snippet exposed below: var calcularSoma = function (primeiroValor, segundoValor) { var soma = primeiroValor + segundoValor; if (soma < 10) { console.log(soma, "Unidades."); return soma; } else if (soma < 100) {...
asked by 07.08.2018 / 16:54
4
answers

Mathematical division needs

On the Windows calculator: 9 / 3,0001 = 2,999 ... In my program: 9 / 3,0001 = 3; I would like to get this level of precision using C. See excerpts from my program: double op(double num1, double num2, char c) { if(c == '/')...
asked by 25.10.2014 / 18:23
2
answers

How to replace the comma

I wanted to know how I can replace the comma to an end point. Example: I have the following number 2.32 I wanted it to be 2.32. How can I do this? I already tried to use ToString(CultureInfo.InvariantCulture) but it still did not...
asked by 06.11.2017 / 17:27
3
answers

Inaccurate result in calculation with broken numbers

Problem Test on the consoles of your browsers: 1067.11-1000 = 67.1099999999999 The correct one would be 67.11 Could anyone explain this to me? And how do I resolve this?
asked by 13.02.2014 / 15:23
4
answers

Mathematical division needs

On the Windows calculator: 9 / 3,0001 = 2,999 ... In my program: 9 / 3,0001 = 3; I would like to get this level of precision using C. See excerpts from my program: double op(double num1, double num2, char c) { if(c == '/')...
asked by 25.10.2014 / 18:23
3
answers

Inaccurate result in calculation with broken numbers

Problem Test on the consoles of your browsers: 1067.11-1000 = 67.1099999999999 The correct one would be 67.11 Could anyone explain this to me? And how do I resolve this?
asked by 13.02.2014 / 15:23