Category "precision"

Do FMA instructions of different CPUs have different intermediate accuracy? If yes, then how does a compiler equalize the floating-point behavior?

When I run fma-optimized horner-scheme polynomial computation (for cosine approximation), it makes 0.161 ulps error on FX8150 but 0.154 ulps on godbolt.org serv

C: Rounding floats

Could you please explain this code: printf("Value1: %0.1f \n", (float)124/100); // = 1.2 printf("Value1: %0.1f \n", (float)125/100); // = 1.2 printf("Valu

Check if number should be C++ float or C++ double using python

I am working on a simple C++ code generator created by excel parsing and I will need to distinguish between number type. I can deduce integer size (e.g. uint_32

Reduce float precission to save memory in Python

I am preparing a code to create an array of 10^5 rows and 10^4 columns with Python. Each element of the array is a float (1.504096744947185, e.g.), which takes

SQL Server - Decimal values not precisely calculated

For the below calculation, the expected result is -0.0000671. But the result of the code is -0.00006800000. declare @V_A decimal (38,11) = 99.99329,

Is it possible to calculate the value after overflow?

I understand that if 1 is added to INT_MAX it will overflow and we will get the negative maximum. It is connected in a cycle. In the code below can I calculate

how to prevent float variables displaying as scientific notation when printing [duplicate]

I am using "(float)$val" for some calculation, but for some decimal value like -0.00000025478625 (float)-0.00000025478625 is resulting to -2.5

Precision gets lost for big number in telegraf

Precision gets lost for big number. I am using tail input plugin to read file and data inside a file is in json format. Below is the configuration [inputs.tail]

What's the maximum precision (after the decimal point) of a float in Javascript

An algorithm I'm using needs to squeeze as many levels of precision as possible from a float number in Javascript. I don't mind whether the precision comes from

Concept related to precision of float and double

Why the precision of the float is up to 6 digits after the decimal point and the precision of the double is up to 15 digits after the decimal point? Can anyone

Is there a standard way to get the nth `nextafter` floating-point value in C++

C++ has std::nextafter(), which returns the next representable value after a given floating-point value f. In my case, I'd like to allow for n bits of slop in t

How to perform binomial-coefficient and factorial calculation with more precision?

I was comparing the result of my following python calculation with Mathematica: https://www.wolframalpha.com/input?i=sum+%28500+choose+r+%29%28-1%29%5Er+%2F%28r

Strange warning when calling sprintf with .* width specifier

For the following code: https://godbolt.org/z/WcGf9hEs3 #include <stdio.h> int main() { char temp_buffer[8]; double val = 25.3; sprint

XGBoost Model performance

I am trying to use XGBoost for classification. I am pretty doubtful on its accuracy. I have applied it with default parameters and the precision is 100%. xg_c

How to control the display precision of a NumPy float64 scalar?

I'm writing a teaching document that uses lots of examples of Python code and includes the resulting numeric output. I'm working from inside IPython and a lot

Project Euler #1 in JavaScript on HackerRank

I'm having some trouble with the test cases for Project Euler #1 on HackerRank and was hoping someone with some JS experience on HackerRank could help out. B

Warp Matrix-Multiply functions - are single-precision multiplicands supported?

In the CUDA Programming guide, v11.7, section B.24.6. Element Types & Matrix Sizes, there's a table of supported type combinations, in which the multiplicat

Working with small probabilities, via logs

Source: Google Code Jam. https://code.google.com/codejam/contest/10224486/dashboard#s=a&a=1 We're asked to calculate Prob(K successes from N trials) where

How do you round a double in Dart to a given degree of precision AFTER the decimal point?

Given a double, I want to round it to a given number of points of precision after the decimal point, similar to PHP's round() function. The closest thing I can

Difference between double- precision data type and numeric data type

What is the difference between double-precision data type and numeric data type in R programming?