Re: [Gambas-user] Precision immediately lost when assigning value to type Single structure property

2014-04-12 Thread Kevin Fishburne
On 04/10/2014 10:50 AM, Jussi Lahtinen wrote: That is completely expected just try: Print csingle(180.2) 180,169 You cannot express 180.2 precisely with 32 bits. Even with 64 bits it's something like: 180.188631 ... Thanks everyone. I knew floating point variables worked

Re: [Gambas-user] Precision immediately lost when assigning value to type Single structure property

2014-04-10 Thread Fabien Bodard
Or store the value as integer an then divide by 10 on use Le 10 avr. 2014 07:09, Ian Haywood ihaywo...@gmail.com a écrit : On Thu, Apr 10, 2014 at 2:43 PM, Kevin Fishburne kevinfishbu...@eightvirtues.com wrote: I have an array (Plan) of a structure (PlanStructure) which contains several

Re: [Gambas-user] Precision immediately lost when assigning value to type Single structure property

2014-04-10 Thread Jussi Lahtinen
That is completely expected just try: Print csingle(180.2) 180,169 You cannot express 180.2 precisely with 32 bits. Even with 64 bits it's something like: 180.188631 ... Jussi On Thu, Apr 10, 2014 at 7:43 AM, Kevin Fishburne kevinfishbu...@eightvirtues.com wrote: I have an

[Gambas-user] Precision immediately lost when assigning value to type Single structure property

2014-04-09 Thread Kevin Fishburne
I have an array (Plan) of a structure (PlanStructure) which contains several other structures (PlanPortalStructure, etc.): ' Architectural plan portal structure (server). Public Struct PlanPortalStructure PlanX As Short' Position in architectural plan. PlanY As

Re: [Gambas-user] Precision immediately lost when assigning value to type Single structure property

2014-04-09 Thread Ian Haywood
On Thu, Apr 10, 2014 at 2:43 PM, Kevin Fishburne kevinfishbu...@eightvirtues.com wrote: I have an array (Plan) of a structure (PlanStructure) which contains several other structures (PlanPortalStructure, etc.): Plan[p].Portal[Index].Orientation = 180.2 the value is assigned as