Page 1 of 1

Accept float operations in complex math formulars!

Posted: Thu Sep 08, 2005 3:08 am
by va!n
Hi PureTeam!
Sometimes i am working with some more complex math formulars! Here is just only a very small example... Would there be any way to do such things in only one line, instead calculating x steps and storing the result in another value!? I would be very glad when one of the next compiler versions would except such operations in one line, if possible ;)

Code: Select all

fNerved.f = (Int(fTest.f) + lAnotherVal.l) % lThisVal 
Its hard to rewrite more complex math formulars! Afaik, such stuff was possible somewhere around v2.50 or v2.70 !?

Posted: Thu Sep 08, 2005 4:07 pm
by MikeB
Probably you already know (probably better than me) that you can get round it with only a slight formula modification using you own procedures, not the best answer but it might help until/if PB allows what you want.

Code: Select all

Procedure.f MyMod(a.f,b.f)
    c.f=a/b
    clong = Int(c)
    ans.f = b*clong
    ans = a-ans
    ProcedureReturn ans
EndProcedure

fTest.f= 3.4
lAnotherVal = 6 ; could also be float
lThisVal = 2    ; could also be float

fNerved.f = MyMod((fTest.f + lAnotherVal.l) , lThisVal )
Debug fNerved
MikeB