Accept float operations in complex math formulars!

Everything else that doesn't fall into one of the other PB categories.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Accept float operations in complex math formulars!

Post 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 !?
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
MikeB
Enthusiast
Enthusiast
Posts: 183
Joined: Sun Apr 27, 2003 8:39 pm
Location: Cornwall UK

Post 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
Post Reply