projects
/
rune.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Rune - Fix array passing, optimize constant array indices
[rune.git]
/
tests
/
float2.d
1
#!/usr/local/bin/rune -x
2
#
3
# Demonstrate constant types. Constants in Rune are effectively what
4
# '#define BLAH 23' would be in C, except they are specifically typed.
5
6
import "sys";
7
import <stdio>;
8
9
alias stdio.File *stdout = stdio.stdout;
10
11
const char NIL = 0UB;
12
13
double D1 = 1.0;
14
double D2 = 2.0;
15
double D3 = 3.0;
16
double D4 = 4.0;
17
18
public
19
int
20
main(int ac, char **av)
21
{
22
double d1;
23
double d2;
24
double d3;
25
double d4;
26
27
d1 = D1;
28
d2 = D2;
29
d3 = D3;
30
d4 = D4;
31
d1 += d2;
32
d1 += d3;
33
d1 += d4;
34
d2 *= d1;
35
d3 /= d1;
36
d4 *= d1;
37
38
return(0);
39
}