\( \newcommand{\br}[1]{\left( #1\right)} \newcommand{\logpar}[1]{\log\left( #1\right)} \newcommand{\cospar}[1]{\cos\left( #1\right)} \newcommand{\sinpar}[1]{\sin\left( #1\right)} \newcommand{\tanpar}[1]{\tan\left( #1\right)} \newcommand{\arcsinpar}[1]{\sin^{-1}\!\left( #1\right)} \newcommand{\arccospar}[1]{\cos^{-1}\!\left( #1\right)} \newcommand{\arctanpar}[1]{\tan^{-1}\!\left( #1\right)} \newcommand{\asin}[1]{\sin^{-1}\! #1} \newcommand{\acos}[1]{\cos^{-1}\! #1} \newcommand{\atan}[1]{\tan^{-1}\! #1} \newcommand{\asinh}[1]{\sinh^{-1}\! #1} \newcommand{\acosh}[1]{\cosh^{-1}\! #1} \newcommand{\atanh}[1]{\tanh^{-1}\! #1} \newcommand{\logten}[1]{\log_{10}\! #1} \definecolor{explaination}{RGB}{0, 166, 226} \newcommand{\ubrace}[2][u]{ { \color{explaination}{\underbrace{ {\color{black}{#2}} }_{#1}} } } \newcommand{\obrace}[2][u]{ { \color{explaination}{\overbrace{ {\color{black}{#2}} }^{#1}} } } \definecolor{highlight}{RGB}{181, 41, 118} \newcommand{\xplain}[1]{{ \textcolor{explaination} { \footnotesize{ #1 \newline}}}} \newcommand{\hilite}[1]{{ \textcolor{highlight} { { #1 }}}} \definecolor{lightergray}{gray}{.675} \newcommand{\hide}[1]{{ \textcolor{lightergray} { \footnotesize{ #1 \newline}}}} \newcommand{\mth}[1]{ { \textcolor{black} { { \small #1 } } } } \)

Übung: Absoluter Betrag

rand(5) > 0 ? randRange( 1, 9 ) : 0 rand(3) > 0 ? randRange(1, 9) : 0 randFromArray([1, -1])

Was ist der Betrag von \lvert localeToFixed( SIGN * (INT + FRAC/10),1) \rvert?

(INT + FRAC/10)
init({ range: [ [-1, 11], [-1, 1] ] }); var start = 0; var end = 10; var originX = 0; var x = abs( (INT + FRAC/10) ); if ( SIGN === -1 ) { start = -10; end = 0; originX = 10; x = 10 - x; } numberLine( start, end ); style({ stroke: "#B5276A", fill: "#B5276A" }); graph.pt = circle( [ x, 0 ], 0.15 ); style({ stroke: "#32b7e8", fill: "#32b7e8", strokeWidth: 3.5, arrows: "->" }); path( [ [ originX, 0 ], [ x, 0 ] ] ); circle( [ originX, 0 ], 0.10 ); graph.pt.toFront();

Der Abstand von 0 zu localeToFixed( SIGN * (INT + FRAC/10),1) ist localeToFixed( (INT + FRAC/10),1), welches der absoluter Betrag ist.

Anders ausgedrückt, localeToFixed( (INT + FRAC/10),1) ist die nicht-negative Version der Zahl localeToFixed( SIGN * (INT + FRAC/10),1).