HISE Logo Forum
    • Categories
    • Register
    • Login

    error C2666: 'snex::hmath::pow': ove rloaded functions have similar conversions

    Scheduled Pinned Locked Moved ScriptNode
    4 Posts 2 Posters 447 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dan KorneffD
      Dan Korneff
      last edited by

      I'm pretty sure I'm doing something stupid, but I'm unable to use Math.pow in my node.
      I've made a simple example with just a Math Expression node and the formula:

      output = input*(Math.abs(input) + value)/(Math.pow(input,2.0) + (value-1.0)*Math.abs(input) + 1.0);
      

      The node works as expected in HISE, but compiling the network as dll gives the error:

       error C2666: 'snex::hmath::pow': ove rloaded functions have similar conversions
      

      mathpower.png

      Anyone spot an error?

      Dan Korneff - Producer / Mixer / Audio Nerd

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @Dan Korneff
        last edited by

        @Dan-Korneff That's because of a mismatch between double and single precision values. The math functions exist in two variants, but if you call a function with one single precision and one double precision argument it might not be able to resolve which function to use.

        If you're using the expr node, then the input will be single precision (because the audio signal is always 32bit float) and the value parameter is double precision (because all parameters in scriptnode are double precision.

        The yellow light also indicates that there is a compiler warning and if you click on the debug symbol, you can see the warning with some pointers on what to do.

        Just cast the inputs so that they are consistently typed:

        input*(Math.abs(input) + value)/(Math.pow(input,2.0f) + (value-1.0f)*Math.abs(input) + 1.0f);
        
        Dan KorneffD 2 Replies Last reply Reply Quote 2
        • Dan KorneffD
          Dan Korneff @Christoph Hart
          last edited by

          giphy.gif

          Dan Korneff - Producer / Mixer / Audio Nerd

          1 Reply Last reply Reply Quote 0
          • Dan KorneffD
            Dan Korneff @Christoph Hart
            last edited by

            @Christoph-Hart said in error C2666: 'snex::hmath::pow': ove rloaded functions have similar conversions:

            The yellow light also indicates that there is a compiler warning and if you click on the debug symbol

            I hadn't noticed this before. Very handy!

            Dan Korneff - Producer / Mixer / Audio Nerd

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            19

            Online

            1.7k

            Users

            11.9k

            Topics

            103.7k

            Posts