Questions tagged as 'ponto-flutuante'

2
answers

Problems calculating on average in Java

I'm trying to make a program that calculates the average of 4 values. Code: private void botao1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: int n1...
asked by 05.02.2016 / 14:55
1
answer

Warning in comparison of floats how to proceed

In an exercise I've made, you're asked to do a compound interest calculation with for for 5% , 6% , 7% , 8% , 9% , and 10% As I could not use a counter check the counter being a type float , or even using switch , then I c...
asked by 19.01.2016 / 00:57
1
answer

Show a specific number of decimal places in floating-point numbers in the Lua language

I started learning a little about the language Lua and I'm doing some algorithms to practice and one of them should show in the output of the floating point values with 4 decimal places. In C ++ I would use cout << fixed << setpre...
asked by 08.08.2016 / 22:28
1
answer

How to manipulate the FPU stack in the x86 assembly using the NASM and functions in c?

I'm trying to do this operation (y = 0.299 * red + 0.587 * green + 0.114 * blue) in assembly mode protected nasm integrating c with assembly in windows, however regardless of the input values the result is always 0. p> extern printf ;a função...
asked by 22.05.2015 / 21:47
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

Floating-point problem Python 3

I'm writing an algorithm where I increment float variables in 0.2 , however, after a few increments instead of increasing 2.2 to 2.4 , for example, the program increments to 2.4000000000000004 I've read about this...
asked by 06.02.2018 / 23:48
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
1
answer

Error: can not convert from double to float

Why float is not accepted for the numbers 0.197 and 0.185? Code: float salBruto, salLiquido; Scanner ent = new Scanner (System.in); System.out.println("Informe o seu salário:"); salBruto = ent.nextFloat(); if (salBruto >= 1500 &...
asked by 17.09.2018 / 05:02
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