Logo

Programming-Idioms

History of Idiom 79 > diff from v16 to v17

Edit summary for version 17 by :
[Perl] Accidentally entered the java implementation

Version 16

2016-02-17, 02:57:14

Version 17

2016-02-17, 02:58:54

Idiom #79 Convert integer to floating point number

Declare floating point number y and initialize it with the value of integer x .

Idiom #79 Convert integer to floating point number

Declare floating point number y and initialize it with the value of integer x .

Code
float y = x;
Code
my $y = $x;
Comments bubble
in perl they are just scalars, there is no distinction between an int and a float