significant-digits Questions
8
It would be nice to have an equivalent of R's signif function in Ruby.
For example:
>> (11.11).signif(1)
10
>> (22.22).signif(2)
22
>> (3.333).signif(2)
3.3
>> (4.4).signi...
Bonaparte asked 5/12, 2011 at 8:24
27
Solved
I need to round a float to be displayed in a UI. e.g, to one significant figure:
1234 -> 1000
0.12 -> 0.1
0.012 -> 0.01
0.062 -> 0.06
6253 -> 6000
1999 -> 2000
Is there a ni...
Nesselrode asked 5/8, 2010 at 0:48
7
Solved
How can I do math involving significant figures in C++? I want this to work correct with measured data from chemistry and physics experiments. An example: 65 / 5 = 10. I would need to get rid of un...
Apothegm asked 5/1, 2011 at 17:58
5
Solved
I would like to be able to round a number to n significant figures in SQL. So:
123.456 rounded to 2sf would give 120
0.00123 rounded to 2sf would give 0.0012
I am aware of the ROUND() function, ...
Fate asked 17/12, 2009 at 10:53
3
Solved
I am plotting some big numbers with matplotlib in a pyqt program using python 2.7. I have a y-axis that ranges from 1e+18 to 3e+18 (usually). I'd like to see each tick mark show values in scientifi...
Chelsae asked 9/9, 2014 at 16:59
6
Solved
I tried below sample code
function sigFigs(n, sig) {
if ( n === 0 )
return 0
var mult = Math.pow(10,
sig - Math.floor(Math.log(n < 0 ? -n: n) / Math.LN10) - 1);
return Math.round(n * mult...
Handmaiden asked 2/4, 2016 at 4:35
2
Solved
I've written a simple code:
sub euler-ex ($x) of Seq {
1, { $x**++$ / [×] 1 .. ++$ } ... Inf }
say " 5: " ~ euler-ex(5)[^20] ~ " = " ~ [+](euler-ex(5)[^20]);
The output:
5: 1 ...
Snowstorm asked 1/11, 2022 at 16:43
17
Solved
If I have a double (234.004223), etc., I would like to round this to x significant digits in C#.
So far I can only find ways to round to x decimal places, but this simply removes the precision if ...
Ave asked 17/12, 2008 at 11:52
6
Solved
Is there a way in Python to count the significant figures in a double/float/etc? I'm not seeing an easy way to do this, but I'd expect it to be in the library.
Thanks in advance.
Berliner asked 12/11, 2011 at 0:0
9
Solved
I have some decimal data that I am pushing into a SharePoint list where it is to be viewed. I'd like to restrict the number of significant figures displayed in the result data based on my knowledge...
Protomorphic asked 1/10, 2008 at 15:21
3
Solved
i've tried this significant figures query from this blog (https://www.garysieling.com/blog/postgres-significant-figures-pg_size_pretty).
But it seems have fixed decimal digit on it.
SELECT FLOOR(...
Moonlit asked 21/2, 2018 at 8:13
3
Solved
I do not want to limit the number of significant digits in a BigDecimal. I only want to find the number of significant digits that number has.
Is there a way to do this without converting the numb...
Tubman asked 29/1, 2014 at 22:9
8
Solved
Is there any slick way to round down to the nearest significant figure in php?
So:
0->0
9->9
10->10
17->10
77->70
114->100
745->700
1200->1000
?
Popedom asked 29/4, 2011 at 16:14
17
Solved
How can you round any number (not just integers > 0) to N significant digits?
For example, if I want to round to three significant digits, I'm looking for a formula that could take:
1,239,451 and...
Camisado asked 14/10, 2008 at 18:37
10
Solved
I am using excel and i want to display a value to a certain number of significant figures.
I tried using the following equation
=ROUND(value,sigfigs-1-INT(LOG10(ABS(value))))
with value replace...
Wyler asked 17/12, 2013 at 22:9
2
Solved
It is possible to round results into two significant digits using signif:
> signif(12500,2)
[1] 12000
> signif(12501,2)
[1] 13000
But are there an equally handy functions, like the fictiti...
Incalescent asked 8/11, 2017 at 10:28
2
Solved
Say I have list [34523, 55, 65, 2]
What is the most efficient way to get [3,5,6,2] which are the most significant digits. If possible without changing changing each to str()?
Archoplasm asked 26/11, 2015 at 22:6
1
So basically I am doing a physics experiment, and in my table I want to have my data rounded to the same accuracy as the error is, which is rounded to 1 sig fig.
So for example if I have the foll...
Oersted asked 22/3, 2017 at 18:12
2
Solved
I have a large dataset that I'm analyzing in R and I'm interested in one column or vector of information. Each entry in this vector has a varied number (ranging from 1-5) of significant figures, an...
Ayeshaayin asked 4/1, 2015 at 16:44
3
Solved
Update
OK, after some investigation, and thanks in big part to the helpful answers provided by Jon and Hans, this is what I was able to put together. So far I think it seems to work well. I wouldn...
Wherefrom asked 10/9, 2010 at 10:1
3
Solved
I have numeric's like this one:
a <- -1.542045
And I want to round them down (or round up the abs) to 2 digits after the decimal point.
signif(a,3) will round it down and give me 1.54 as a r...
Mart asked 1/10, 2016 at 1:47
2
There's been a lot of questions on rounding by significant figures, and answers that that provides a new method to do the rounding, such as:
Rounding to an arbitrary number of significant digits
...
Haygood asked 21/10, 2013 at 6:22
3
I would like the output of my R console to look readable. To this end, I would like R to round all my numbers to the nearest N decimal places. I have some success but it doesn't work completely:
&...
Ethnogeny asked 31/3, 2013 at 18:11
3
Solved
I've come across two different precision formulas for floating-point numbers.
⌊(N-1) log10(2)⌋ = 6 decimal digits (Single-precision)
and
N log10(2) ≈ 7.225 decimal digits (Single-prec...
Coltun asked 6/6, 2015 at 23:1
10
Solved
I keep getting mixed answers of whether floating point numbers (i.e. float, double, or long double) have one and only one value of precision, or have a precision value which can vary.
One topic ca...
Disentwine asked 29/5, 2015 at 19:11
1 Next >
© 2022 - 2024 — McMap. All rights reserved.