Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {==============================================================================]
- Explanation: Returns fraction of source.
- [==============================================================================}
- function FractionOf(fraction, source: Extended): Extended;
- begin
- if (fraction <> 0) then
- Result := (fraction * source)
- else
- Result := 0.0;
- end;
- begin
- ClearDebug;
- WriteLn(FractionOf(0.01, 123.456));
- WriteLn(FractionOf(0.1, 123.456));
- WriteLn(FractionOf(0.25, 123.456));
- WriteLn(FractionOf(0.5, 123.456));
- WriteLn(FractionOf(1.0, 123.456));
- end.
Advertisement
Add Comment
Please, Sign In to add comment