Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Manual entry for FLOAT

ssabpablo
Beginner
352 Views
How does Intel Fortran Compiler for Linux (8.1) treat a code-line
with FLOAT? I can't find anything in the manual concerning this.
(Ex: A = FLOAT(B) )
Pablo
0 Kudos
4 Replies
Steven_L_Intel1
Employee
352 Views
Did you try looking up FLOAT in the index? FLOAT is an intrinsic function which is treated the same as REAL without a second argument. The statement A=FLOAT(B) converts B to type "default real" (usually REAL(4)) and then assigns the value to A following the rules of intrinsic assignment.

I am not sure what you mean by "manual entry".
0 Kudos
TimP
Honored Contributor III
352 Views
That's interesting, but it's written up under REAL, as it has been in the Fortran standards for many years. It's standard Fortran, even though it has fallen into disuse, and is not mentioned in certain textbooks (e.g. Metcalf, Reid, Cohen). It produces a default real result. There is apparently also an extension for complex, where it produces a real of the same kind as the complex, which seems a particularly inadvisable usage in the case of complex of non-default kind.

Message Edited by tim18 on 05-02-200606:34 AM

0 Kudos
ssabpablo
Beginner
352 Views

Thanks for your quick reply.

It is as I thought. I was only somewhat concerned because I couldn't

find FLOAT when searching in the Intel Fortran Language Reference manual.

(Found only DFLOAT and QFLOAT)

0 Kudos
Steven_L_Intel1
Employee
352 Views
As Tim says, it is found under the description of REAL (and also in the table of specific function names). It is also listed in the Intel Fortran Language Reference index: "FLOAT function, 9-131".
0 Kudos
Reply