fortran - SELECTED_REAL_KIND in C -
is there equivalent of selected_real_kind (in fortran) in c language ?
selected_real_kind
standard fortran mechanism choosing @ build time real data type meets or exceeds specified parameters numeric representation. in particular, used select data type precision , / or exponent range , / or radix.
standard c not have built-in parameterized facility such designating data types. does have standard macros values describe properties of implementations of standard floating-point types, float
, double
, , long double
. joint radix, precisions in both decimal digits , implementation-radix digits, , minimum , maximum exponent values (also in both decimal , implementation-radix forms) available via these macros. these defined in standard header float.h
. (the link posix, formally aligned c standard here.)
it possible use c preprocessor conditionals , these macros define macros or typedefs types meet specific requirements, can use throughout code. not tidy fortran's approach, gets job done.
Comments
Post a Comment