Re: v13 Compiled vs Interp execution

2018-02-22 Thread Keisuke Miyako via 4D_Tech
number literals are always typed real, regardless of decimals. http://doc.4d.com/4Dv15/4D/15.5/Constants.300-3577854.en.html you could code hexadecimals to enforce integer 0x01 but that's kind of nerdy... predefined constants are also pre-typed.

Re: v13 Compiled vs Interp execution

2018-02-22 Thread Chuck Miller via 4D_Tech
As an aside I would use a local variable so command would look like this c_real($MyNumber_R) $MyNumber_R:=500.0 $real:=2*(MAXLONG-$MyNumber_R) I do this so that 4D does not reset results based upon what it thinks it should do I think it will work even without the .0 Regards Chuck

RE: v13 Compiled vs Interp execution

2018-02-22 Thread Chip Scheide via 4D_Tech
Thanks! > I think that using the MAXLONG constant is causing the value to be > treated as a longint. > $Real := 2 * (MAXLONG - 500) > > If you replace the MAXLONG constant with a value you get the correct result: > $Real := 2 * (2147483647 - 500) > > Interestingly, you can keep using

RE: v13 Compiled vs Interp execution

2018-02-22 Thread Timothy Penner via 4D_Tech
I think that using the MAXLONG constant is causing the value to be treated as a longint. $Real := 2 * (MAXLONG - 500) If you replace the MAXLONG constant with a value you get the correct result: $Real := 2 * (2147483647 - 500) Interestingly, you can keep using the MAXLONG constant if

Re: v13 Compiled vs Interp execution

2018-02-22 Thread Chip Scheide via 4D_Tech
yes $real is declared as Real. That is the first thing I checked :) > Do you have a C_REAL($Real) line in your code? The compiler might be > typing that variable as a longint. > > Dani > >> On Feb 22, 2018, at 10:14 AM, Chip Scheide via 4D_Tech >> <4d_tech@lists.4d.com> wrote: >> >> I have

Re: v13 Compiled vs Interp execution

2018-02-22 Thread Dani Beaubien via 4D_Tech
Do you have a C_REAL($Real) line in your code? The compiler might be typing that variable as a longint. Dani > On Feb 22, 2018, at 10:14 AM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > I have code that converts a value from REAL to Hex. > as part of my test routines, maximum

v13 Compiled vs Interp execution

2018-02-22 Thread Chip Scheide via 4D_Tech
I have code that converts a value from REAL to Hex. as part of my test routines, maximum value convertible is Maxlong (php routine) I set the value to convert to (to test out of range error): $Real := 2 * (MAXLONG - 500) $Real := 2 * (2147483647 - 500) $Real := 2 * (2142483647) $Real :=