Approx: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
PRanz (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
|||
| Zeile 20: | Zeile 20: | ||
approx(10/3) --> returns 3.33333333333333 | approx(10/3) --> returns 3.33333333333333 | ||
'''Jack2:''' | |||
approx([var=E]) --> returns 2.71828182845905 | approx([var=E]) --> returns 2.71828182845905 | ||
approx('e') --> returns 2.71828182845905 | approx('e') --> returns 2.71828182845905 | ||
'''Jack3:''' | |||
approx(constE()) --> returns 2.71828182845905 | |||
approx('e') --> returns 2.71828182845905 | |||
'''Jack2:''' | |||
approx([var=PI]) --> returns 3.14159265358979 | approx([var=PI]) --> returns 3.14159265358979 | ||
approx('pi') --> returns 3.14159265358979 | approx('pi') --> returns 3.14159265358979 | ||
'''Jack3:''' | |||
approx(constPi()) --> returns 3.14159265358979 | |||
approx('pi') --> returns 3.14159265358979 | |||
==== Benutzung mit Variablen ==== | ==== Benutzung mit Variablen ==== | ||
Version vom 25. November 2020, 21:51 Uhr
Zugehörige Evaluatoren
- MathEvaluator
Beschreibung
Die Funktion approx liefert eine annäherungsweise korrekte Darstellung einer Funktion oder eines Objekts. Die Funktion gibt die Annäherung als eine Gleitkommazahl zurück.
Syntax
approx(Objekt objekt)
Parameter
- objekt - das zu approximierende Objekt
Return Value
- Gibt eine Gleitkommazahl zurück
Beispiele
Standardfälle
approx(10/3) --> returns 3.33333333333333
Jack2:
approx([var=E]) --> returns 2.71828182845905
approx('e') --> returns 2.71828182845905
Jack3:
approx(constE()) --> returns 2.71828182845905
approx('e') --> returns 2.71828182845905
Jack2:
approx([var=PI]) --> returns 3.14159265358979
approx('pi') --> returns 3.14159265358979
Jack3:
approx(constPi()) --> returns 3.14159265358979
approx('pi') --> returns 3.14159265358979
Benutzung mit Variablen
approx([pos=1]) approx([var=a]) approx([var=a])