Re: [Oorexx-devel] Problem? with OORexx API function ObjectToDouble

2021-04-20 Thread Erich Steinböck
> > it should not be difficult to directly generate a double value You'd think so, but read these stunning strtod() algorithm descriptions (a must-read for anyone who likes math). https://www.exploringbinary.com/how-strtod-works-and-sometimes-doesnt/

Re: [Oorexx-devel] Problem? with OORexx API function ObjectToDouble

2021-04-20 Thread Ruurd Idenburg
Rick is right I guess, see result from "LC_NUMERIC=C rexx osmmap.rex" --- ruurd@Paradigit2:~/newrxgtk/GTKv3/test$ LC_NUMERIC=C rexx osmmap.rex As CSTRINGs - Latitude: 52.289875;Longitude: 4.8448525 As objects -

Re: [Oorexx-devel] Problem? with OORexx API function ObjectToDouble

2021-04-19 Thread Rick McGuire
On Mon, Apr 19, 2021 at 5:09 PM Erich Steinböck wrote: > Hi Ruurd, instead of defining your latitude/longitude arguments as CSTRING > and then manually converting them, you can define your arguments as (e. g.) > float and have Rexx do the conversion for you. > > ~~~ > float lat, // Latitude

Re: [Oorexx-devel] Problem? with OORexx API function ObjectToDouble

2021-04-19 Thread Erich Steinböck
Hi Ruurd, instead of defining your latitude/longitude arguments as CSTRING and then manually converting them, you can define your arguments as (e. g.) float and have Rexx do the conversion for you. ~~~ float lat, // Latitude in decimal degrees float lon, // Longitude in decimal degrees

Re: [Oorexx-devel] Problem? with OORexx API function ObjectToDouble

2021-04-19 Thread Ruurd Idenburg
I guess I found the cause. It's the decimal point vs the decimal comma (for my locale) that is causing the behaviour. If I set the latitude and longitude in an ENVIRONMENT variable via VALUE and retrieve those with GObject "g_getenv" function, then all goes well if I use the comma as decimal

Re: [Oorexx-devel] Problem? with OORexx API function ObjectToDouble

2021-04-19 Thread Ruurd Idenburg
In the real code the tildes in the printf as objects are "->". Made a mistake when I type the code manually. On 4/19/21 3:50 PM, Ruurd Idenburg wrote: Given the following code: /**  * Method: OsmMapPointNew  *  * Create a new OsmMapPoint.  *  * @return 0  **/ RexxMethod3(int,