Map range: Difference between revisions

→‎{{header|Ada}}: fix wrong example used
(→‎{{header|C}}: Maked incorrect. C++ has right output, for example.)
(→‎{{header|Ada}}: fix wrong example used)
Line 9:
 
=={{header|Ada}}==
 
{{incorrect|Ada|Wrong output.}}
<lang Ada>with Ada.Text_IO;
procedure Map is
type First_Range is new Float range 10.0 .. 10.0;
type Second_Range is new Float range -1.0 .. 0.0;
function Translate (Value : First_Range) return Second_Range is
Line 45:
 
Output:
<pre> 10.00000E+00 maps to: -1.00000E+00
21.00000E+00 maps to: -89.88889E00000E-01
32.00000E+00 maps to: -78.77778E00000E-01
43.00000E+00 maps to: -67.66667E00000E-01
54.00000E+00 maps to: -56.55556E00000E-01
65.00000E+00 maps to: -45.44444E00000E-01
76.00000E+00 maps to: -34.33333E00000E-01
87.00000E+00 maps to: -23.22222E00000E-01
98.00000E+00 maps to: -12.11111E00000E-01
9.00000E+00 maps to: -1.00000E-01
1.00000E+01 maps to: 0.00000E+00</pre>
 
256

edits