Skip to main content

Questions tagged [rounding]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
2 answers
244 views

How to transfer a numerical value in Mathematica into a symbolic fraction with sufficiently large precision?

Suppose I have a number $0.26630939883535015$ and want to transfer it into a symbolic fraction by truncating it first. The way I do it is first Round it and then <...
narip's user avatar
  • 381
0 votes
0 answers
59 views

Rounding the solution of NSolve

How do I round x and y solved in the equation to only integer solutions? I get an error no matter where I put ...
hare's user avatar
  • 436
1 vote
2 answers
118 views

Smooth out numerical fluctuation at known point

I have the following function ...
Frotaur's user avatar
  • 285
1 vote
0 answers
85 views

Am I losing precision in manually entered equations?

I am using the following code to calculate the two solutions of a quadratic equation in the variable t. ...
iontrap's user avatar
  • 11
1 vote
3 answers
160 views

How can I get these decimals formatted properly?

It's nothing serious, but I was just wondering. I have a large number of floating point numbers which I write to a file. Mathematica writes each number with 17 decimal positions, which is way more ...
stevenvh's user avatar
  • 6,958
2 votes
3 answers
703 views

Rounding Real number

I have real numbers in array, I want to round (or truncate) these numbers to 2-digit after decimal point, then I want to write values to Excel File For example if I have ...
user81348's user avatar
1 vote
1 answer
81 views

Rounding Issue with a number containing "`"

I would like to round a number saved in a weird format (I have no idea what the "`" means, could someone explain?) to 3 digits: ...
Luke's user avatar
  • 838
4 votes
1 answer
131 views

Round to certain values

For a program I write I need some optimal values. I calculated them using Mathematica and I get something like this: ...
Arji's user avatar
  • 1,134
0 votes
0 answers
165 views

Rounding corners of lines

I can easily produce rectangles with rounder corners using RoundingRadius. However, I am unable to do for an open curve ...
Mark Robinson's user avatar
0 votes
0 answers
48 views

What is the limit of digits to show in the conversion of an exact number to an Arbitrary Precision Number?

By executing something like N[π, c] what is the maximum positive integer value c can have until the output is compromised by ...
FRANCESCO's user avatar
2 votes
1 answer
288 views

Is NumberForm double rounding numbers?

A number like 0.644696875 is represented internally as 0.6446968749999...: N[FromDigits[RealDigits[0.644696875, 2], 2], $MachinePrecision] (* 0.6446968749999999 *) ...
Gustavo Delfino's user avatar
8 votes
3 answers
855 views

Count number of occurences of particular numbers in list

I have a list of numbers which I have rounded and now all numbers are divisible by 5. ...
Vocis's user avatar
  • 195
2 votes
1 answer
192 views

Efficient Round edition with different rounding direction

As pointed out in this post, Mathematica has a special version of Round that Round rounds numbers of the form x.5 toward the nearest even integer. A comment by ...
matheorem's user avatar
  • 17.2k
3 votes
3 answers
298 views

Problems with rounding giving too many digits

My current code is: ...
Wombles's user avatar
  • 792
0 votes
0 answers
97 views

Return the precision of the first non zero digit in a number for measurement error representation function

I'd like to return the precision of the first non zero digit in a number. The motivation is so that I can quickly construct my error notation which is the bracketed notation, e.g. $x = 1.234$ with ...
user27119's user avatar
  • 2,520
1 vote
1 answer
5k views

Rounding a number to decimal places and keeping a trailing zero

It's often useful for me to round numbers to some decimal place for printing on a graph or figure. I usually do this by: ...
user27119's user avatar
  • 2,520
1 vote
2 answers
137 views

How can I Influence the number of digits when printing a polynomial expression or when I want to make it a String?

I have an expession (it is the result of Fit) but I want to print or display an abbreviated form with all numbers in it rounded to say 6 decimal digits. ...
Adalbert Hanßen's user avatar
2 votes
0 answers
94 views

Why does Mathematica round numbers in this way where the fractional part is 0.5? [duplicate]

I was trying to comment on sequence https://oeis.org/A047229 in the OEIS, when one of the editors pointed out that the rounding is done wrong in this Mathematica one-liner: ...
Mats Granvik's user avatar
  • 1,159
1 vote
1 answer
466 views

Chop not working [closed]

I am running a function that has a large output in matrix format with small, complex parts added to the numbers- basically a rounding error. I am trying to use Chop to obtain use-able results, but ...
Laura McMullen's user avatar
3 votes
1 answer
293 views

Create an accumulator array from a function

I am making some images for a project about the hough transform line detection, I am showing the slope-intercept form , the normal form and their accumulator arrays to show the peaks. I am kind of new ...
EinsL's user avatar
  • 83
5 votes
3 answers
569 views

Opposite Collatz Conjecture

I'm trying to explore what would happen if you change the collatz conjecture to flip the equations for odds and evens. So if you have an even number you multiply by 3, add 1, and divide by 2. If you ...
Dops's user avatar
  • 153
1 vote
3 answers
239 views

Keep leading/trailing zeroes (like Defer except with numbers) in a given number

I'm trying to write a function that counts the number of significant figures a given number has so I can ensure my calculations are rounded correctly; however, I am having a lot of trouble preventing ...
hedgepig's user avatar
  • 113
0 votes
1 answer
351 views

Why doesn't the Round function work on decimals and how to fix it or work around it [duplicate]

I'm trying to specify yaxis tick labels from 0 to 1.0 in steps of 0.1. This is what I get: ...
Tom Mozdzen's user avatar
6 votes
2 answers
1k views

Round vs. Floor vs. Ceiling for non-integers non-orders-of-magnitude

I understand that Round give the nearest even integer for cases where the number is between two integers, i.e. Round[2.5] = 2 ...
ThomasH's user avatar
  • 435
6 votes
1 answer
175 views

Is the divergence between Round and setting an explicit precision intentional or a bug?

Introductory remark: I take it (from Mathematica's online documentation), that Precision is effectively the number of significant digits, as seen by the system. ...
Jinxed's user avatar
  • 3,753
3 votes
3 answers
3k views

Rounding to the nearest decimal and pasting such output into an Input cell

This question is very closely related to two earlier ones: Rounding to the nearest decimal and How do you round numbers so that it affects computation? but confronts an additional issue not ...
David G. Stork's user avatar