RPNTUTORIAL(1) rrdtool RPNTUTORIAL(1) (NAME) rpntutorial - RPN RRDtool Steve Rader (DESCRIPTION) RPN ( ) RRDtool CDEF RRDtool graph . (Reading Comparison Operators) RPN LT LE GT GE EQ . ( ) . . (true) <<1>> . (false) <<0>> . <<2,1,GT>> . RPN << >> . <<>> . <<1>> . RPN 2,1,GT 1 . <<2,1,LE>> . RPN << >> . <<>> RPN 2,1,LE 0 . IF (Reading the IF Operator) IF RPN . IF <> ( X Y Z) ** . IF : IF. IF (<>) IF (<>) . RPN <> : <>. <<1,10,100,IF>> . <> : 1 10 . (false) (true) . <<2,20,200,IF>> (<>) 20 <<0,1,2,IF>> (<>) 2 . <> << Y Z>> . IF LT LE GT GE EQ . (Some Examples) . RPN : . ( ) (pop ) . <<1,2,3,+,+>> <<2,3,+>> ( <<2+3>>) 5 . <<1,5,+>> . <<1,5,+>> 6 . : 1) 1,2,3,+,+ eval is 2,3,+ = 5 result is 1,5,+ 2) 1,5,+ eval is 1,5,+ = 6 result is 6 3) 6 RPN : 1) 20,10,GT,10,20,IF eval is 20,10,GT = 1 result is 1,10,20,IF eval : <<20 10 >> (pop ) 1 (push ). 2) 1,10,20,IF eval is 1,10,20,IF = 10 result is 10 : <> (pop ) 10 (push ). 10 10 . RPN : 1) 128,8,*,7000,GT,7000,128,8,*,IF eval 128,8,* result is 1024 2) 1024 ,7000,GT,7000,128,8,*,IF eval 1024,7000,GT result is 0 3) 0, 7000,128,8,*,IF eval 128,8,* result is 1024 4) 0, 7000,1024, IF result is 1024 20 <> : 1) input,10,GT,10,input,IF eval is input,10,GT ( lets call this A ) eval << input > 10 (true)>> <> <> : 2) A,10,input,IF eval is A,10,input,IF : <>. A --!-- : if input > 10 then 10 else input 128 <> : 1) input,8,*,7000,GT,7000,input,8,*,IF eval input,8,* result is A A <> 2) A,7000,GT,7000,input,8,*,IF eval is A,7000,GT result is B B < 7000) then true>> 3) B,7000,input,8,*,IF eval is input,8,* result is C C <> 4) B,7000,C,IF RPN : if ((input * 8) > 7000) then 7000 else (input * 8) (Exercises) : <<3,2,*,1,+>> <<3,2,1,+,*>> . . . : 3*2+1 = 7 3*(2+1) = 9. . : : input,8,*,56000,GT,56000,input,*,8,IF <> : input,56000,GT,56000,input,IF,8,* . LE DIV . : if (input <= 56000/8 ) { input*8 } else { 56000 } input,56000,8,DIV,LE,input,8,*,56000,IF : . RPN . : . ( ) . RPN . : RPN RRDtool . : RPN . RPN Tobias Oetiker ! ( .) (AUTHORS) Steve Rader 1.11.0 2026-08-08 RPNTUTORIAL(1)