Difference between revisions of "Slash"
Line 1: | Line 1: | ||
<div style="float:left; margin: 0 10px 10px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;"><nowiki>/</nowiki></div> | <div style="float:left; margin: 0 10px 10px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;"><nowiki>/</nowiki></div> | ||
− | The '''''/''''' or '''slash''' is used in a [[Pascal]] program to perform division. The results are a real value. If you want integer type value then use the [[Div|div]] operator, [[round]] or [[trunc]] function . | + | The '''''/''''' or '''slash''' is used in a [[Pascal]] program to perform division. The results are a real value. If you want integer type value then use the [[Div|div]] operator, [[Round|round]] or [[Trunc|trunc]] function . If you want know remainder use [[Mod|mod]]. |
<delphi> | <delphi> |
Revision as of 11:17, 22 November 2007
The / or slash is used in a Pascal program to perform division. The results are a real value. If you want integer type value then use the div operator, round or trunc function . If you want know remainder use mod.
<delphi>
A := 3 / 4;
</delphi>
returns 0.75 if a is real (if a is integer-type then get error:Incompatible types).
The value on the right side of the slash must not be zero, or a division by zero error occurs. This can be caught through use of a try .. finally or try .. except block.
single characters |
|
character pairs |
|