Re: gtk_init breaks fortran data operation
- From: Jean Bréfort <jean brefort normalesup org>
- To: Alexander Varnin <fenixk19 mail ru>
- Cc: gtk-list gnome org
- Subject: Re: gtk_init breaks fortran data operation
- Date: Sun, 28 Nov 2010 15:58:31 +0100
gtk_init sets the locale. I suppose that the data file contains the
numbers as strings. If your locale uses a comma as decimal separator,
the parser can't interpret the dot and just loads the integer part of
the first number.
Regards,
Jean
Le dimanche 28 novembre 2010 à 17:20 +0300, Alexander Varnin a écrit :
> Hello.
> I'm writing an application, that combines GTK calls (from C source)
> and fortran subroutine.
> Behavior of subroutine depends on when it gets called - before
> gtk_init or after.
> If it is called before gtk_init, subroutine works OK. If subroutine is
> called after gtk_init, fortran behaves very strange: it reads floating
> point value from file, but it gets only integer part of it. In first,
> correct case, it reads normal floating point value.
>
> Code
> >printf("This call is correct:\n");
> >main_in_ ();
> >gtk_init (&args_length1, &args);
> >printf("And this is already broken:\n");
> >main_in_ ();
> Gives following output
> >This call is correct:
> > dt == 7.30000019E-11
> >And this is already broken:
> > dt == 7.0000000
>
> Why does gtk_init affect fortran way of reading value? How it can be
> fixed?
> Small testcase attached.
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]