Rational: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Keine Bearbeitungszusammenfassung |
K (→Beispiele) |
||
| Zeile 15: | Zeile 15: | ||
===Beispiele=== | ===Beispiele=== | ||
rational(2,5) --> returns <math>\frac{2}{5}</math> | |||
2/5 --> returns <math>\frac{2}{5}</math> | |||
rational(2,a) --> returns <math>\frac{2}{a}</math> | |||
rational(a,b) --> returns <math>\frac{a}{b}</math> | |||
rational(sin(a),b) --> returns <math>\frac{sin(a)}{b}</math> | |||
rational(cos(0),a) --> returns <math>\frac{1}{a}</math> | |||
===Hinweise=== | ===Hinweise=== | ||
Version vom 25. September 2018, 09:15 Uhr
Beschreibung
rational gibt die Dezimalbruchdarstellung zweier Zahlen zurück. Nicht zu verwechseln mit Division.
Syntax
a/b rational(a,b)
Parameter
Return Value
- Gibt ein Objekt zurück.
Die Rückgabe ist abhängig von der Eingabe. Dabei wird soweit wie möglich die Eingabe ausgerechnet.
Beispiele
rational(2,5) --> returns <math>\frac{2}{5}</math>
2/5 --> returns <math>\frac{2}{5}</math>
rational(2,a) --> returns <math>\frac{2}{a}</math>
rational(a,b) --> returns <math>\frac{a}{b}</math>
rational(sin(a),b) --> returns <math>\frac{sin(a)}{b}</math>
rational(cos(0),a) --> returns <math>\frac{1}{a}</math>