5,608 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
43
views
How to round very big float number into x numbers after decimal point in Scheme?
I have a Scheme interpreter written in JavaScript called LIPS.
And a recent version of Node changed the precision of the floating-point numbers by one digit (Node 24, because of V8 change).
So (expt 0....
Advice
0
votes
13
replies
223
views
Which algorithm does the truncate function use in c++
I'm wondering how the truncate function works. C++ is just an example i'm using because it's a language I know. I've searched online and I can't seem to find how it works, simply how to use it and ...
4
votes
3
answers
258
views
PHP 8.4 rounding gives different result than 8.2
I am in the process of upgrading our code from php 8.2 to 8.4
I noticed we are getting some test failures because of round() returning different values than expected. Ultimately the problem could be ...
1
vote
0
answers
44
views
Showing actual percentiles in locust reports
Is there a way to compute proper percentiles in Locust? The values are always rounded off to a multiple of 10.
I have read about Locust only estimating percentiles to save resources. But is there a ...
0
votes
1
answer
115
views
Missing round_to() function in PPP_support.h
I'm currently working through Bjarne Stroustrup's Programming: Principles and Practice Using C++ (3rd Edition).
The book mentions a function named round_to() is provided in PPP_support.h
When, on the ...
0
votes
0
answers
54
views
Is there a known issue with Spark version 3 behaving differently and inconsistent to Spark version 2 when rounding decimal points?
My project is having a problem with decimal rounding errors in Spark v3 compared to Spark v2, where rounding to second decimal place works fine in Spark v2 but Spark v3 rounds the values up or down (...
2
votes
1
answer
83
views
Change the decimal value of each value in each column to 0.5 while maintaining the same leading integer python pandas
CONTEXT
I am NOT trying to round to the nearest 0.5. I know there are questions on here that address that. Rather, I am trying to change the decimal value of each value in each row to 0.5 while ...
2
votes
0
answers
88
views
GNU Octave not assigning closest double to a number literal - Can you reproduce? Is it a bug? [closed]
In GNU Octave 10.2.0, when I run x = 1.000444, I seem not to get the closest double to the real number 1.000444. Not even tied:
>> format long
>> x = 1.000444
x = 1....
5
votes
2
answers
139
views
Update MySQL database column to round all values to 2 decimal places
I have a MySQL database of some 5000 products imported from Excel a while ago. Unfortunately, Excel truncates values with trailing zeroes so they were imported into the Price column in a mix of values ...
2
votes
1
answer
72
views
Difference in rounding between .NET 6 and .NET 8?
I'm having trouble understanding why the same code is producing different results between .NET 6 and .NET 8 environments.
Specifically, I'm trying to understand why 'end' is not equal to 'newEnd'.
...
52
votes
2
answers
4k
views
Why is 0.0 printed as 0.00001 when rounding upward?
If in a C++ program, I activate upward rounding mode for floating-point numbers and print some double-precision value already rounded to an integer, e.g.:
#include <cfenv>
#include <iostream&...
0
votes
1
answer
87
views
Problem with Leave-one-out analysis forest plot
I am relatively new to RStudio as this is my first meta-analysis ever. Up until now, I have been following some online guides and got myself to use the meta package. Using the metagen function, I was ...
-2
votes
2
answers
97
views
Number should be rounding to two decimal places but its not [duplicate]
print("Welcome to the tip calculator!")
bill = float(input(f"What was the total bill? £"))
tip = int(input("How much tip would you like to give? 10, 12 or 15? "))
people =...
0
votes
2
answers
64
views
Why isn't the signif function working for Banker's even rounding for 0.6745? [duplicate]
For this example, I am working with the following data:
Z_Value <- c(-0.6745, 0.6745)
I'm using the following function and want to use 3 sig figs. (If I have results that are 999 or higher, I want ...
2
votes
1
answer
195
views
How to implement Scheme's float, ceil, and round that work on exact rationals in JavaScript?
I just found about these two expressions in Scheme:
(quotient (expt 1000 999) 998001)
(floor (/ (expt 1000 999) 998001))
They return bigInt that looks like this 100200300 ... 999 (with all numbers ...