Author Topic: Problem with pow  (Read 2620 times)

0 Members and 1 Guest are viewing this topic.

Brian Alvarez

  • Guest
Re: Problem with pow
« Reply #15 on: March 01, 2020, 06:17:39 AM »
Charles, the macro functions like this:

Code: [Select]
MACRO ¤MOD quad(r, v, e)
    r = mod(v, e)
END MACRO


Fail to compile when the invocation contains a parameter with empty brackets like this:

Code: [Select]
print ¤MOD(something(), 2)
Code: [Select]
ERROR: ERROR: Undefined Symbol: )
WORD: 0

Do you think it would be possible to take a look into it before the next update?

Brian Alvarez

  • Guest
Re: Problem with pow
« Reply #16 on: March 01, 2020, 06:30:32 AM »
Seems like it only happens with #if

Code: [Select]
MACRO ¤EXAMPLE string(r, dd, d2)
    #if typecodeof(dd) = 0x68
        r = str(dd)
    #endif
END MACRO


« Last Edit: March 01, 2020, 06:47:00 AM by Brian Alvarez »

Charles Pegge

  • Guest
Re: Problem with pow
« Reply #17 on: March 01, 2020, 10:32:32 AM »
Brian,

I will extend typeof and typecodeof to support arrays and functions

Brian Alvarez

  • Guest
Re: Problem with pow
« Reply #18 on: March 01, 2020, 11:52:33 AM »
Thanks Charles.  :) I tried passing the function without the empty brackets, but then it complained about the comma right after the function, so the brackets were necessary.

Charles Pegge

  • Guest
Re: Problem with pow
« Reply #19 on: March 02, 2020, 03:39:07 AM »
That is quite simple to fix, Brian, but supposing you pass a polymorphic-function or object-method in dd... I need to think deeper.

Brian Alvarez

  • Guest
Re: Problem with pow
« Reply #20 on: March 02, 2020, 01:30:21 PM »
That is perfect Charles. I need to select wich function to invoke manually because under some circumstances, the function overflow likes to invoke str() as if it was a floating value with integer values, and returns 0.9999999999999 instead of 1.