[PDD] Add docs for the Parrot_PMC_push_* and Parrot_PMC_pop_* functions
[parrot.git] / examples / tutorial / 10_math_ops.pir
blob192b9db34cd3068d7d2c35845f3f176ef553e42d
1 # Copyright (C) 2007-2009, Parrot Foundation.
2 # $Id$
4 =head1 Math Operations
6 Many common math operations have simple operator syntax in
7 PIR. Operators like C<+>, C<->, C</> and C<*> are all
8 implemented in PIR, but so are a few less common ones such
9 as C<<< << >>>, C<<< >> >>>, C<|>, C<&>, C<^>  and C<%>.
11 =cut
13 .sub main :main
15     $I0 = 5
16     $I1 = $I0 + 2
17     print $I1
18     print "\n"
20     $N0 = 6.7
21     $N1 = $N0 - 1.5
22     print $N1
23     print "\n"
25 .end
27 # Local Variables:
28 #   mode: pir
29 #   fill-column: 100
30 # End:
31 # vim: expandtab shiftwidth=4 ft=pir: