On 2008-08-26 22:31-0700 Jerry wrote:

Attached is a zip file (sans ".zip") that contains two programs, one in Ada and one in C, which print out some machine integer and floating point attributes. (Actually, the C version doesn't to floats right now.) Also included are the results of running them on my machine, OS X 10.4.11. (The version of OS X being sold in stores right now is 10.5.4.)

To compile the Ada program, type gnatmake ada_machine_attributes.adb.

It would be interesting to see what results some of you get on your 64-bit machines.

The results are attached as two separate files.  I hope they help you sort
out the problem.  Note, however, that many of these C integer size results
are irrelevant to the PLplot C library API since PLINT (the type used for
integer arguments for the PLplot API) is defined with a size of 32 bits on
all platforms that use the C99 standard for C.  That includes my platform
even though my hardware is 64 bits.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

===== SOME BASIC ADA ATTRIBUTES =====

===== This program uses an enum type defined as (dog, mica, megabit).

Boolean bits is  1
Short_Short integer bits is 8
Short_Integer bits is  16
Integer bits is  32
Long_Integer bits is  64
Long_Long_Integer bits is  64
Natural bits is  31
Positive bits is  31
Short_Float bits is  32
Float bits is  32
Long_Float bits is  64
Long_Long_Float bits is  128
Our 3 item enumerated bits is  2

First Integer is -2147483648
Last Integer is  2147483647

First enumerated is DOG
Last enumerated is MEGABYTE
Mica is in position 1
The third enumerated is MEGABYTE

The smallest Float is 2.58493941422821148E-26
The largest Float is 1.93428038904620299E+25
The number of digits in Float is 6
The size of the Float mantissa in bits is 21
However, the CPU's Float mantissa is 24

The smallest Long_Float is 1.94469227433160678E-62
The largest Long_Float is 2.57110087081438330E+61
The number of digits in Long_Float is 15
The size of the Long_Float mantissa in bits is 51
However, the CPU's Long_Float mantissa is 53

The smallest Long_Long_Float is 1.76868732008334226E-74
The largest Long_Long_Float is 2.82695530364541493E+73
The number of digits in Long_Long_Float is 18
The size of the Long_Long_Float mantissa in bits is 61
However, the CPU's Long_Long_Float mantissa is 64

===== Some data sizes from Complex_Types:
Complex from Complex_Types bits is 64

===== Some data sizes from Long_Complex_Types:
Complex from Long_Complex_Types bits is 128

===== Some data sizes from Interfaces.C based on Declarations in C's <limits.h>
===== Read about the Ada package Interfaces C at
===== http://www.adaic.com/standards/05rm/html/RM-B-3.html
In Interfaces.C, CHAR_BIT is 8
In Interfaces.C, SCHAR_MIN is -128
In Interfaces.C, SCHAR_MAX is 127
In Interfaces.C, UCHAR_MAX is 255
In Interfaces.C, nul is NUL
In Interfaces.C, char16_nul is NUL
In Interfaces.C, char32_nul is NUL

In Interfaces.C, int bits is 32
In Interfaces.C, short bits is 16
In Interfaces.C, long bits is 64
In Interfaces.C, signed_char bits is 8
In Interfaces.C, unsigned bits is  32
In Interfaces.C, unsigned_short bits is 16
In Interfaces.C, unsigned_long bits is 64
In Interfaces.C, unsigned_char bits is 8
In Interfaces.C, plain_char bits is 8
In Interfaces.C, C_float bits is 32
In Interfaces.C, double bits is 64
In Interfaces.C, long_double bits is 128
In Interfaces.C, char bits is 8
In Interfaces.C, wchar_t bits is 32
In Interfaces.C, char16_t bits is 16
In Interfaces.C, char32_t bits is 32




        Character Types
Number of bits in a character: 8
Size of character types is 1 byte
Signed char min: -128 max: 127
Unsigned char min: 0 max: 255
Default char is signed

        Short Int Types
Size of short int types is 2 bytes
Signed short min: -32768 max: 32767
Unsigned short min: 0 max: 65535

           Int Types
Size of int types is 4 bytes
Signed int min: -2147483648 max: 2147483647
Unsigned int min: 0 max: 4294967295

        Long Int Types
Size of long int types is 8 bytes
Signed long min: -9223372036854775808 max: 9223372036854775807
Unsigned long min: 0 max: 18446744073709551615
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to