Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Map-range/XPL0/map-range.xpl0
Normal file
13
Task/Map-range/XPL0/map-range.xpl0
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
include c:\cxpl\codes;
|
||||
|
||||
func real Map(A1, A2, B1, B2, S);
|
||||
real A1, A2, B1, B2, S;
|
||||
return B1 + (S-A1)*(B2-B1)/(A2-A1);
|
||||
|
||||
int I;
|
||||
[for I:= 0 to 10 do
|
||||
[if I<10 then ChOut(0, ^ ); IntOut(0, I);
|
||||
RlOut(0, Map(0., 10., -1., 0., float(I)));
|
||||
CrLf(0);
|
||||
];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue