On Aug 26, 2008, at 10:00 AM, Alan W. Irwin wrote:

On 2008-08-26 00:56-0700 Jerry wrote:

Finally, a dumb question. Is there any chance that floats, ints,
doubles, etc. in C or Floats, Integers, Long_Floats, or Long_Integers
in Ada have different sizes between languages on 64-bit boxes than on
32-bit boxes?

I think there is a very good chance that the Ada language as implemented by gnat has different sizes for floats and especially integers than PLplot so maybe that is the source of the problem here. Recall that for the default PL_DOUBLE case, PLFLT is a double. Also, for platforms (32-bit or 64-bit)
with access to stdint.h, PLINT is a 32-bit integer (int32_t, see
include/plplot.h).  My feeling is stdint.h (e.g., access to the C99
standard) is pretty common. Anyhow, it is available on my 64-bit computer. Thus, if Ada is assuming a 64-bit integers on 64-bit platforms, that would
not be the same size as PLINT on my computer.

Alan

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.

Jerry

Attachment: machine_precistion_tests
Description: Binary data



-------------------------------------------------------------------------
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