Skip to main content

Questions tagged [rounding]

Rounding a numerical value means replacing it by another value that is approximately equal but has a shorter, simpler, or more explicit representation.

rounding
-1 votes
0 answers
67 views

Round() function in C++ not rounding off my float correctly? [duplicate]

when I input - 12345678901234567890.1 the output - 12345679395506094080 instead of 12345678901234567890 and this problem only applies to massive number like this one. this code is for a code forces ...
Utkarsh Kamath's user avatar
1 vote
1 answer
70 views

How does rounding works in float multiplication?

The exact value of float 0.7f is 0.69999... so I thought the result of 0.7f * 100f would be something below 70, like 69.99999... But the result is exact 70. Does float multiplication involve such ...
yahoic's user avatar
  • 13
0 votes
2 answers
37 views

How to round all numbers to 2 in the whole flutter project?

I am working on a flutter app with banking numbers, and therefore only needs two decimal numbers. Is there a way to round every number automatically in my whole project at once ? The idea is to not ...
salomepx's user avatar
1 vote
0 answers
98 views

Why does using any in-built functions not rounding a 0.5 decimal to 1? [duplicate]

I need to round off each decimal values to its nearest whole number, anything less than 0.4 to be rounded off to 0, and 0.5 and above to be rounded off to 1. But when i try that in C++ no matter which ...
Kevin Jonathan's user avatar
0 votes
1 answer
57 views

ROUND() for decimal places with ZEROs [duplicate]

When I attending a SQL challenge, I am asked to write a query to find average ticket price which is rounded off to 2 decimal places. I got answer as 42.5,55.But the test case is not passed because the ...
Rakshitha Kundapur's user avatar
-4 votes
1 answer
62 views

How would I round a number to a grid using python?

I would like to know how to round numbers to a grid using python. Here is pseudo-code to demonstrate: GRID_SIZE = 20 def snap_function(): # snap here pass snapped_number = snap_function(68) ...
Benjamin Ecker's user avatar
-1 votes
2 answers
84 views

How to round to 100 in SQL [duplicate]

select concat(round((sum(gender='M')/count(gender)) * 100, 100), '%') as per_num from patients The question is to find the % of patients who's gender is M and round to the nearest hundreth ...
Reshma Reghunandan's user avatar
1 vote
0 answers
59 views

R: non-uniform 'Rounding' sampler used [closed]

For a while now, I have the following message when I launch R: In sys.load.image("chemin vers le nom du fichier .RData", : non-uniform 'Rounding' sampler used If I launch R without the ...
Eric Wajnberg's user avatar
0 votes
0 answers
33 views

Round or Truncate for Money Operation

operations via decimal (for example a multiplication) are rounded by default (so for example with a decimal with scale of 2, a number 0.126 will be saved 0.13 on the database. By doing operations ...
Mr McDonald's user avatar
2 votes
1 answer
100 views

IEEE floating-point rounding in C

I am having trouble to understand a specific IEEE double computation. Take the following C99 program, that runs on a host with IEEE double (8 bytes, 11 bits biased exponent, 52 bits encoded mantissa):...
emacs drives me nuts's user avatar
0 votes
2 answers
52 views

Excel's Round Function to JavaScript does not providing consistent results with compared to Excel

While translating the ROUND function from Excel to JavaScript, it's noted that the differences in how each language handles floating-point arithmetic. In JavaScript, the .toFixed() method is not ...
Vishnu Prakash's user avatar
0 votes
1 answer
28 views

Problems with rounding datetime

I am having problems rounding the datetime columns in my dataset. I need to round a dataset to the nearest half an hour so I can use it with another dataset that have been already rounded. I have ...
Gonzalo de Quesada's user avatar
0 votes
1 answer
32 views

ROUND_HALF_DOWN in informix

i tried the round with mode syntax but it's giving me an error in informix (3.50). Can you help me please or give me other alternative if mode is not supported in this version? Thank you in advance
salma's user avatar
  • 171
0 votes
1 answer
36 views

Is there any function extracting DD/MM/YY HH:MM:SS in BigQuery to hh:mm:ss?

In the bigquery-public-data.new_york_taxi_trips.tlc_yellow_trips_2022, the dropoff_datetime and pickup_datetime are in DD/MM/YY HH:MM:SS format, and I want to find pickup_location_id and subquery....
MARPLE NGUYEN's user avatar
0 votes
0 answers
25 views

predict function used independently in RStudio shows the result considering all decimal places, but when it is inside a loop result is truncated? Why?

When predict function is used independently in RStudio, it shows the result by considering all decimal places, but when it is embedded in a loop, the result is truncated? Why? I used different ...
Abhijeet Mankar's user avatar

15 30 50 per page
1
2 3 4 5
372