Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

Is is safe to assign real*8 to real*4 after bound check?

$
0
0

Hi there,

We're using 64-bit  ifort  on linux and its version is  11.1 056.

I have to assign the value of a real*8 variable var_r8 to another real*4 variable var_r4.

If var_r8 is checked to be within upper/lower bounds of real*4, is it save to use
var_r4 = var_r8

In case var_r8 exceeds the smallest number which can be handled by real*4, var_r4 can be set as 0.0.

 

Your opinion is very much appreciated.


Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>