ScientificErrorAnalysis
GetRule
return the procedure of a rounding rule
Calling Sequence
Parameters
Description
Examples
GetRule( name )
name
-
symbol; name of an available rule
The GetRule( name ) command returns the procedure that performs the action of the rule name.
There is no procedure available for the rule 'digits'.
For more information on predefined rules in ScientificErrorAnalysis, see Predefined Rounding Rules.
with⁡ScientificErrorAnalysis:
GetRule⁡round
procx,ylocalxp,yp,n,usen;ifnottype⁡procname,'indexed'thenerror`round` must be indexedend if;n ≔ op⁡procname;ifnottype⁡n,'posint'thenerrorinvalid index to `round`end if;xp,yp ≔ evalf⁡x,evalf⁡y;ifxp<>0thenusen ≔ n+ilog10⁡SFloatMantissa⁡xp − ilog10⁡SFloatMantissa⁡yp+SFloatExponent⁡xp − SFloatExponent⁡yp;iftype⁡usen,'integer'thenifusen<1then0.,evalf[n]⁡ypelseevalf[usen]⁡xp,evalf[n]⁡ypend ifelseevalf[n]⁡xp,evalf[n]⁡ypend ifelse0.,evalf[n]⁡ypend ifend proc
See Also
Rounding rules
ScientificErrorAnalysis[AddRule]
ScientificErrorAnalysis[ApplyRule]
ScientificErrorAnalysis[GetRules]
ScientificErrorAnalysis[HasRule]
Download Help Document