[fpc-devel]urgent: double + integer question

Michael Van Canneyt michael.vancanneyt at wisa.be
Wed Feb 6 17:46:22 CET 2002


On Wed, 6 Feb 2002, raoul s wrote:

> Hi,
>
> I have "a" as double and "b" as integer.
> 1) how may I say "a := b" in pascal. "a" on left and
> "b" on the
> right.
>

Just write

  a:=b;

The compiler does the typeconversion.


> 2)can one way would be?:
> a := b + 0.0;

You can do that but it is not necessary.

>
> i like to keep the results for a as double.

An assignment cannot change the type of the left side.

Michael.





More information about the fpc-devel mailing list