Syntax
[xr,sr]=roundgauss([x,s,n])
Input Parameter
x : | | Mean Value |
s : | | Standard deviation |
n : | | number of measurement; if 1 we use 2 significant numbers |
Output Parameter
xr : | | mean rounded |
sr : | | standard deviation rounded |
Examples
[x,s]=roundgauss(123.45678,34.567890,2)
[x,s]=roundgauss(123.45678,34.567890,10)
[x,s]=roundgauss(123.45678,34.567890,100)
[x,s]=roundgauss(123.45678,3.4567890,1000)
References
ISO 80000-1Additional Hyperlinks
Copyright 2021-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This algorithm is designed to round a mean value and its standard deviation based on the number of measurements. It is part of the SolidGeometry library and was introduced by Tim Lueth.
Input Parameters
- x: Mean Value
- s: Standard deviation
- n: Number of measurements; if n=1, two significant numbers are used
Output Results
- xr: Mean rounded
- sr: Standard deviation rounded
Algorithm Steps
- Retrieve input parameters x, s, and n using the function
getfuncparams
.
- Set a resolution
res
to 0.01.
- If
n > 1
:
- Calculate
sx = s / sqrt(n)
.
- Compute
aaa = -sx * erfinvGauss(res)
.
- Determine
ff = ceil(log10(x / aaa)) + 1
.
- Calculate
ee = ceil(log10(x))
.
- Round
x
to ff - ee
significant figures and assign to xr
.
- Round
s
to ff - ee + 1
significant figures and assign to sr
.
- If
n = 1
:
- Calculate
ee = ceil(log10(x))
.
- Determine
xn = 3 - ee
and sn = 4 - ee
.
- Round
x
to xn
significant figures and assign to xr
.
- Round
s
to sn
significant figures and assign to sr
.
Example Usage
[x,s]=roundgauss(123.45678,34.567890,2)
[x,s]=roundgauss(123.45678,34.567890,10)
[x,s]=roundgauss(123.45678,34.567890,100)
[x,s]=roundgauss(123.45678,3.4567890,1000)
Algorithm explaination created using ChatGPT on 2025-08-19 08:13. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21