Set of real numbers: Difference between revisions
Content added Content deleted
MaiconSoft (talk | contribs) (Remove "{{omit from|Delphi}}" tag and added Delphi example) |
m (→{{header|Phix}}: minor simplification (use %t)) |
||
Line 2,175:
{"[0,2) n (1,2]", {0,0,0}, {Inter,{{ClOp,{0,2}},{OpCl,{1,2}}}}},
{"[0,3) - (0,1)", {1,1,1}, {Diffr,{{ClOp,{0,3}},{OpOp,{0,1}}}}},
{"[0,3) - [0,1]", {0,0,1}, {Diffr,{{ClOp,{0,3}},{ClCl,{0,1}}}}}}
for i=1 to length(s) do
Line 2,183 ⟶ 2,182:
bool r = cf(method,x)
string error = iff(r!=expect[x+1]?"error":"")
printf(1,"%d in %s : %
end for
printf(1,"\n")
Line 2,189 ⟶ 2,188:
{{out}}
<pre>
0 in (0,1] u [0,2) :
1 in (0,1] u [0,2) :
2 in (0,1] u [0,2) :
0 in [0,2) n (1,2] :
1 in [0,2) n (1,2] :
2 in [0,2) n (1,2] :
0 in [0,3) - (0,1) :
1 in [0,3) - (0,1) :
2 in [0,3) - (0,1) :
0 in [0,3) - [0,1] :
1 in [0,3) - [0,1] :
2 in [0,3) - [0,1] :
</pre>
Extra credit - also translated from Go, but with an extended loop and crude summation, inspired by Java/Kotlin.
|