Re: Integer Coersion




"PJH" <abc@xxxxxxxxxxx> wrote in message
news:12shvt6l0gun25f@xxxxxxxxxxxxxxxxxxxxx

"David Frank" <dave_frank@xxxxxxxxxxx> wrote in message
news:Lg5yh.21388$w91.9682@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

"PJH" <abc@xxxxxxxxxxx> wrote in message
news:12sgvsvle6sr8c1@xxxxxxxxxxxxxxxxxxxxx

Also, has anyone any advice on how to check the number of bits in a
REAL
variable.

Paul Holden



nbits = sizeof(anything)*8


Thanks David. I was hoping to avoid non-standard intrinsics and
assumptions
about bits-per-byte. But I can't see any other way to do it, so I guess
this
is going to be my simplest solution.


Several points..
1. Your compiler (IVF) supports SIZEOF as do several others including my
CVF compiler.
2. Its amazing to me that people are bending their syntactic noses out of
shape to allow a memory byte
to be other than 8bits when cheap memory came on the scene and BURIED
those mfg's computers
models that didnt support it..
3. Since 2 is true, (ALL memory today is organized/addressed by hardware as
8bit entities) it follows
that AFAIK no compiler being sold today doesnt recognize the 1 byte
integer declaration,

INTEGER(1) :: one_byte

and those that support quad precision (intel, ibm, et al) support bytes
as the de-facto standard for reals also

REAL(4) :: x
REAL(8) :: y
REAL(16) :: z

IOW, BYTES RULE!! screw those that try to jam KIND syntactic
horrors down our collective throats
ignoring the recent standardization of physical memory that has occurred
SINCE F90 was first approved.



.



Relevant Pages

  • Re: accessing memory addresses using C
    ... the part about needing to define the memory in the linker command file is correct. ... the F2812 uses 16 bits as its natural width and while CHAR declarations are supported and will work you need to be extra careful when doing so. ... The exact syntax of the variable will depend on whether you are using C or C++ (consult the compiler manual for examples). ... As far as C++ and the F2812 goes, the compiler does support a limited subset of C++. ...
    (comp.dsp)
  • Re: INTEGER*3
    ... INTEGER*1, INTEGER*2, and INTEGER*4, and some compilers also support a fourth kind of integer, namely INTEGER*8. ... With the size of audio files created with 24-bit samples and 96 kHz sampling, the largest audio file that one can fit into a given memory size is less than it could be if the extra byte of memory wasn't wasted. ... the ideal solution would be to have a compiler that supports ...
    (comp.lang.fortran)
  • Re: mixing C and assembly
    ... standard one that comes with the compiler you will never need to see it. ... support processor register access. ... Our initial startup code was written ... memory chip selects and block remapping to do. ...
    (comp.arch.embedded)
  • Re: whole number constants
    ... is required to issue an error message. ... the same kind values for integers and reals of the same ... as even if the compiler ... fact that the standard doesn't require compilers to support ...
    (comp.lang.fortran)
  • Re: 128GB MMU pages ? / was: Re: Solaris page sizes
    ... > The compiler accepts 8K,64K,512K,4M,32M,256M,2G,16G. ... Is it possible that the documentation skipped 2GB by accident? ... Depends on how fast SPARC hardware can handle more memory... ... I guess adding 128GB page support starts to make sense when a ...
    (comp.unix.solaris)