Jump to content

log VOP?


jonp

Recommended Posts

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?

Link to comment
Share on other sites

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. :blink: I find that odd that there isnt a VOP for calculating that. Should make in an RFE.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...