Arjen Markus <
arjen.m...@gmail.com> schrieb:
> I read this with interest, but I do not quite understand the
> issue with the generics with two integers. Could you explain this
> further via the C interface? (I did not find that documentation
> immediately so gave up after 60 seconds ;)).
The point was that I wanted the user to be able to write
- fmpfr ("1.2") (default digits, default rounding)
- fmpfr ("1.2",100) (100 binary digits, default rounding)
- fmpfr ("1.2", mpfr_rndz) (default digits, round towards towards zero)
- fmpfr ("1.2", 100, mpfr_rndz) (100 binary digits, round towards zero)
and I was a little bit stuck in my head because I thought that
mpfr_rnd_t had to be an integer (it is a C enum), so I chose an 8-bit
int for it.
However, a better solution is actually rather simple: Make a
derived type and declare parameters with the values of the enum.
Duh. I think I will implement that next.
Source code compatibility yes, but not yet binary compatibility :-)
Nice thing is that I the code generation is in a script, I will
only have to change a few places.
> Also, with respect
> to array intrinsics, you could simply start with one-dimensional
> versions, as I imagine that will be the most common use case.
That would be relatively easy, but I would prefer a more general
solution. Maybe a combination of SELECT RANK and pointer rank
remapping would work for this to be doable in Fortran. Doing
this in C would be a) no fun and b) more or less a duplication
of libgfortran, which I would hate to do.