jonp Posted September 13, 2008 Share Posted September 13, 2008 Is there a way in VOPS to get the log of a number? Or a nice way to create a new VOP using vex to return log? Quote Link to comment Share on other sites More sharing options...
SpencerL Posted September 13, 2008 Share Posted September 13, 2008 Is there a way in VOPS to get the log of a number? Or a nice way to create a new VOP using vex to return log? Hey Jon The Exponential VOP gives you the natural log. Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted September 13, 2008 Share Posted September 13, 2008 The Exponential VOP gives you the natural log. Hmmm... how would that work exactly? If I wanted to express ln(x) as a power of e, I would have to write eln(ln(x)), wouldn't I? (which would put me right back where I started). What am I missing here? Anyway, the functions log(), and log10() are available in VEX but they haven't been wrapped as VOPs yet. The quickest solution would be to use an InlineVOP. Alternatively, you could create your own wrapper. Creating your own wrapper that includes all the signatures of the base functions and which also provides logarithms to arbitrary bases (ln(x)/ln(base)) would take quite a bit of explaining (and I don't feel like typing that much ), so I made a quick wrapper that you can dissect on your own time when/if you feel like it. vop_log.otl I didn't test it that much, but I *think* it works... P.S: I haven't made a VOP through the UI like that in a while, but I couldn't find any way to tag a string parameter as "unquoted" (I ended up copy-pasting the "type" parameter from the trig vop because it's unquoted). I know this can be done through #pragma's in VEX code, but in VOPs? Anyone know where they put the magical, mystical unquoted button? I remember RFE'ing this waaaaaay back when VOPs came out, and it obviously made it to VEX, but unless I missed it, I don't think it's available in the Operator Type Properties dialog... or is it? Quote Link to comment Share on other sites More sharing options...
SpencerL Posted September 13, 2008 Share Posted September 13, 2008 Hmmm... how would that work exactly?If I wanted to express ln(x) as a power of e, I would have to write eln(ln(x)), wouldn't I? (which would put me right back where I started). What am I missing here? Anyway, the functions log(), and log10() are available in VEX but they haven't been wrapped as VOPs yet. The quickest solution would be to use an InlineVOP. Alternatively, you could create your own wrapper. Creating your own wrapper that includes all the signatures of the base functions and which also provides logarithms to arbitrary bases (ln(x)/ln(base)) would take quite a bit of explaining (and I don't feel like typing that much ), so I made a quick wrapper that you can dissect on your own time when/if you feel like it. vop_log.otl I didn't test it that much, but I *think* it works... P.S: I haven't made a VOP through the UI like that in a while, but I couldn't find any way to tag a string parameter as "unquoted" (I ended up copy-pasting the "type" parameter from the trig vop because it's unquoted). I know this can be done through #pragma's in VEX code, but in VOPs? Anyone know where they put the magical, mystical unquoted button? I remember RFE'ing this waaaaaay back when VOPs came out, and it obviously made it to VEX, but unless I missed it, I don't think it's available in the Operator Type Properties dialog... or is it? Ooops! I just assumed it did all that. I never tested the Exponential VOP, much less looked at it, I just knew it existed. I find that odd that there isnt a VOP for calculating that. Should make in an RFE. Quote Link to comment Share on other sites More sharing options...
jonp Posted September 13, 2008 Author Share Posted September 13, 2008 Thank you Mario, you answered both questions and also gave me a nice wrapper to look at... very helpful! Strange though that there is no log VOP included. Thanks anyways, Spenc. Quote Link to comment Share on other sites More sharing options...
old school Posted September 15, 2008 Share Posted September 15, 2008 There is an old school blog series on how to create your own cop wrapper on vex code. Saves Mario some typing. Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted September 15, 2008 Share Posted September 15, 2008 There is an old school blog series on how to create your own cop wrapper on vex code. Hey Jeff, Any idea on how to tag a string parameter as "unquoted" via the Type Properties Dialog? (i.e: how to add "parmtag script_unquoted" to a string parameter using the UI). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.