[Done] Type casting changed

All bugs related to new C backend
Lord
Enthusiast
Enthusiast
Posts: 731
Joined: Tue May 26, 2009 2:11 pm

[Done] Type casting changed

Post by Lord »

The behaviour of type casting changed:

Code: Select all

Define Result.f
Define a.i
Define b.i
Define af.f
Define bf.f

a=1
b=3
result=a/b
Debug result
result= 1/3
Debug result

af=1
result=af/b
Debug result

bf=3
result=a/bf
Debug Result
This piece of code gives with ASM backend:
0.33333334326744
0.33333334326744
0.33333334326744
0.33333334326744]
the C backend gives:
0.0
0.33333334326744
0.33333334326744
0.33333334326744
The ASM backend could devide two integer and get a float.
Now at least the divisor or the dividend has to be a float.

Is this the intended behaviour from now (then I have to change
a lot of code) or is it something that will be changed back?
Image
Fred
Administrator
Administrator
Posts: 14302
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Type casting changed

Post by Fred »

The idea for now is the be 1:1 with the ASM backend.
Fred
Administrator
Administrator
Posts: 14302
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Type casting changed

Post by Fred »

Fixed.
Post Reply