Hello Everyone!
I'm have a problem with TD7.4.3. I'm trying to execute the function SalNumberMod with negative numbers[Example: SalNumberMod(-10, 1)], but always return the same number(in this example, always return -10).
Anyone knows whats happening?
Sorry about my english grammar errors, my english isn't good.
SalNumberMod with negative numbers
Re: SalNumberMod with negative numbers
Hi brunocheles,
checked this with TD 7.4.1. The results are ok:
It seems this is a TD 7.4.3 problem?!
checked this with TD 7.4.1. The results are ok:
Code: Select all
SalNumberMod(-10, 1) => 0
SalNumberMod(-10, 4) => -2
SalNumberMod( 10, 4) => 2
Best regards,
Michael Ehehalt
Michael Ehehalt
Re: SalNumberMod with negative numbers
Hi brunocheles,
I do not see this error with TD7.4.3. Build 67790: Regards Thomas
I do not see this error with TD7.4.3. Build 67790: Regards Thomas
You do not have the required permissions to view the files attached to this post.
Re: SalNumberMod with negative numbers
There is no problem in TD 7.4.3, the results are correct.
The function SalNumberMod uses the so called truncated division to calculate the modulo, in which the sign of the result depends on the sign of the dividend (the first parameter of the function).
If for some reason you need the absolute value, use
The function SalNumberMod uses the so called truncated division to calculate the modulo, in which the sign of the result depends on the sign of the dividend (the first parameter of the function).
If for some reason you need the absolute value, use
Code: Select all
Set nResult = SalNumberMod( SalNumberAbs( -10 ), 4 )
Igor Ivanovic


Re: SalNumberMod with negative numbers
Hello guys,
I've written the wrong version.
I'm using TD7.4.2 Build 67386 and I've finally found the problem.
For some reason the dll 'cdlli74.dll' in that version caused this error to me.
I've tried the same thing in TD7.4.1 and worked normally.
I've written the wrong version.
I'm using TD7.4.2 Build 67386 and I've finally found the problem.
For some reason the dll 'cdlli74.dll' in that version caused this error to me.
I've tried the same thing in TD7.4.1 and worked normally.
Who is online
Users browsing this forum: [Ccbot] and 0 guests