Re: random ints on symmetric interval
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: random ints on symmetric interval         

Group: comp.lang.fortran · Group Profile
Author: glen herrmannsfeldt
Date: Sep 18, 2008 18:02

Ron Ford wrote:
(snip, I wrote)
>>The other half are negative numbers minus positive numbers,
>>with the result below -8.
> Of course, you mean below negative seven, but the other half of cases is
> almost suggested by the custom quote there with the negative in front of
> the first arg and then the same positive values on the right.

For twos complement it would be -8. In the large number limit,
it won't make a big difference.
> It was so simple to write a fortran program that the busts the C int
> datatype. One thing I dislike so much about c is struggling with the
> format specifiers with printf, while with fortran it's just print * for
> something quick and sleazy.

Fortran didn't used to make it so easy. Otherwise, in many
cases the C format descriptors are easier to use than those
in Fortran.

C has always had the ability to specify the format descriptor
without a width, such that an appropriate width is used.
Fortran now has I0, and maybe F0, E0, and G0.

There is no other way for printf to know the data type
of its argument than the format string.

-- glen
no comments
diggit! del.icio.us! reddit!