# Questions tagged as 'ponto-flutuante'

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

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

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

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

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

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

## 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...
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?
2

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