[Numpy-discussion] C vs. Fortran order -- misleading documentation?

David Goldsmith d.l.goldsmith@gmail....
Wed Jun 9 11:08:06 CDT 2010


On Wed, Jun 9, 2010 at 9:00 AM, David Cournapeau <cournape@gmail.com> wrote:

> On Thu, Jun 10, 2010 at 12:09 AM, Benjamin Root <ben.root@ou.edu> wrote:
> >> I think that arrays are just syntax on pointer is indeed the key
> >> reason for how C works here. Since a[b] really means a + b (which is
> >> why 5[a] and a[5] are the same), I don't see how to do it differently.
> >
> > Holy crap!  You can do that in C?!
>
> Yes:
>
> #include <stdio.h>
>
> int main()
> {
>        float a[2] = {1.0, 2.0};
>
>        printf("%f %f %f\n", a[1], *(a+1), 1[a]);
> }
>

This is all _very_ educational (and I mean that sincerely), but can we
please get back to the topic at hand ( :-) ).  A specific proposal is on the
table: we remove discussion of the whole C/Fortran ordering issue from
basics.indexing.rst and "promote" it to a more advanced document TBD.

DG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100609/6716a27c/attachment.html 


More information about the NumPy-Discussion mailing list