# Questions tagged as 'ponto-flutuante'

2

## 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...
1

## 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...
1

## 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...
1

## 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...
3

## 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?
4

## 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 == '/')...
3

## 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...
3

## 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?
1