PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tutorial/number/example4.e

http://github.com/tybor/Liberty
Specman e | 26 lines | 20 code | 3 blank | 3 comment | 0 complexity | 2b1209dcc679956830ca29b6d8fb3e6f MD5 | raw file
 1class EXAMPLE4
 2   --
 3   -- Other examples to view NUMBERs.
 4   --
 5
 6create {ANY}
 7   make
 8
 9feature {ANY}
10   make
11      local
12         n: NUMBER
13      do
14         n := 1.to_number / 5.to_number
15         io.put_string("(" + n.to_string + ").to_decimal(5,true) -> ")
16         io.put_string(n.to_decimal(5, True) + "%N")
17         io.put_string("(" + n.to_string + ").to_decimal(5,false) -> ")
18         io.put_string(n.to_decimal(5, False) + "%N")
19         n := 2.to_number / 3.to_number
20         io.put_string("(" + n.to_string + ").to_decimal(10,true) -> ")
21         io.put_string(n.to_decimal(10, True) + "%N")
22         io.put_string("(" + n.to_string + ").to_decimal(10,false) -> ")
23         io.put_string(n.to_decimal(10, False) + "%N")
24      end
25
26end -- class EXAMPLE4