Questions tagged as 'ponto-flutuante'

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

Why are floating-point primitives divided or multiplied by certain multiples of 10 displayed in scientific notation?

In this answer we can see that Java has a peculiarity when displaying the result in certain types of operations with types primitives that have a floating point, such as division by multiples of 10, which can be seen in the example taken from...
asked by 21.12.2017 / 20:00
3
answers

Realization of floating-point accounts in JavaScript with absolute precision

I'm working with financial values and at the time of performing mathematical operations in JavaScript, values are not as expected. console.log(11.8-10.2) 1.6000000000000014 I would like to know how to solve this precision problem to alway...
asked by 04.05.2014 / 17:03
4
answers

Why is 0.1 + 0.05 not equal to 0.15? What solutions can be used in R?

No R : 0.1+0.05 == 0.15 [1] FALSE Why does this occur? How to get around the situation (functions and packages to handle floating points)? Edition: This other question already contains general point answers floating, thus...
asked by 21.02.2014 / 17:06
2
answers

Negative variance in R? Floating-Point Error Propagation

Suppose the following formula to calculate the variance: variancia <- function(x) { n <- length(x) (1/(n^2-n))*(n*(sum(x^2))-(sum(x)^2)) } See that it is equivalent to the var function in most cases: teste <- 1:5 var(t...
asked by 21.02.2014 / 21:14
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
3
answers

Split result gives zero in the decimal places

In the 1 by 3 division, my program is printing the following:    the value of number e 'of 0.00 What is the error in the code? #include <stdio.h> int main(){ float numero; numero = 1/3; printf("o valor do numero e'...
asked by 10.12.2014 / 23:31
1
answer

Why is the expression (double.MinValue == double.MinValue + 1) true?

The following C # code: public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine(double.MinValue == double.MinValue + 1); Console.WriteLine(int.MinValue == int.MinV...
asked by 21.09.2017 / 00:25
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
2
answers

What is and what is the reserved word "strictfp" for?

I'm not aware of this keyword, I've never seen an example code used. Until I discovered her existence today when reading some books on Java, however it was not clear what the utility. What is strictfp ? What is it for? When to use?     
asked by 29.12.2014 / 22:14