Cant use any operand on floats

Just starting out? Need help? Post your questions and find answers here.
User avatar
MrTAToad
Posts: 291
Joined: Sun Apr 20, 2014 11:43 am
Location: Chichester, England
Contact:

Cant use any operand on floats

Post by MrTAToad »

With this :

Code: Select all

Define a.b=2
Define b.b=4
Define c.f=6

#P1 = 5
#P2 = 128

If ((a & #P1) And (c>4.0)) Or ((b & #P2) And (c>5.0))
  Debug "H"
EndIf
I get the "Cant use any of the following operands on floats" error message for some reason
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: Cant use any operand on floats

Post by Fred »

Yes, the whole expression is promoted to float as soon a float is used. That's a compiler limitation unfortunately.
User avatar
MrTAToad
Posts: 291
Joined: Sun Apr 20, 2014 11:43 am
Location: Chichester, England
Contact:

Re: Cant use any operand on floats

Post by MrTAToad »

Ah right - in that case, the comparisons will have to be modified a bit.
Post Reply