floating-accuracy
Dealing with small numbers and accuracy
I have a program where I deal with a lot of very small numbers (towards the lower end of the Double limits).[详细]
2023-02-07 04:53 分类:问答Is casting to float destructive?
In PHP, I know we shouldn\'t do math on floats without things like bcmath, but is the mere act of casting a string to float destructive?[详细]
2023-02-03 23:33 分类:问答0.1 + 0.7 != 0.8 [duplicate]
开发者_JAVA技巧This question already has answers here: Is floating point math broken? (31 answers)[详细]
2023-02-02 03:07 分类:问答How to correctly and standardly compare floats?
Every time I start a new project an开发者_Python百科d when I need to compare some float or double variables I write the code like this one:[详细]
2023-02-02 00:51 分类:问答How to get around rounding issues in floating point arithmetic in C++?
Im running into some issues with floating point arithmetic not being accurate. I\'m trying to calculate a score based on a weighted formula where every input variable weighs about as much as 20 times[详细]
2023-01-29 02:20 分类:问答Not exactly converts from double to int - seems problem is in CPU instructions
I got surprised when I debugged my code. Here I provide example code 开发者_如何学编程#include<QMessageBox>[详细]
2023-01-28 10:25 分类:问答IEEE-754 floating-point precision: How much error is allowed?
I\'m working on porting the sqrt function (for 64-bit doubles) from fdlibm to a model-checker tool I\'m using at the moment (cbmc).[详细]
2023-01-27 21:32 分类:问答Check if a number is rational in Python, for a given fp accuracy
I would like to kn开发者_开发百科ow a good way of checking if a number x is a rational (two integers n,m exist so that x=n/m) in python.[详细]
2023-01-26 12:49 分类:问答How can I 'trim' a C# double to the value it will be stored as in an sqlite database?
I noticed that when I store a double value such as e.g. x = 0.56657011973046234 in an sqlite database, and then retrieve it later, I get y = 0.56657011973046201. According to the sqlite spec and the .[详细]
2023-01-25 05:33 分类:问答splitting the bill algorithmically & fair, afterwards :)
I\'m trying to solve the following real-life problem you might have encountered yourselves: You had dinner with some friends and you all agreed to split the bill evenly. Except that when the bill fin[详细]
2023-01-20 10:13 分类:问答