Page 1 of 1

math ability

Posted: Thu Jun 19, 2008 9:13 pm
by tinker
Hi all
is there a list specifying what math functions are available in flowcode ?

cheers
joe

Re: math ability

Posted: Fri Jun 20, 2008 9:45 am
by Benj
Hi Joe

Here is the list of functions taken from the latest help file.

( ) - Parentheses.
= <> -Equal to, Not equal to.
+ - * / MOD - Addition, Subtraction, Multiplication, Division & Modulus.
< <= > >= - Less than, Less than or equal to, Greater than, Greater than or equal to.
>> << - Shift right, Shift left.
NOT AND OR XOR - NOT(inversion), AND, OR, Exclusive OR


Functions (Flowcode for ARM only)
Flowcode includes an additional set of mathematical functions:

fabs( x ), floor( x ), ceil( x ) - absolute value, floor and ceiling functions
round( x ) - decimal rounding (x rounded to the nearest integer)
fround( x , y ) - floating point rounding (x rounded to y decimal places)
fmod( x , y ) - floating point modulus (remainder of x divided by y)
sqrt( x ), cbrt( x ) - square and cube roots
log( x ), log10( x ) - logarithms (base e and base 10)

exp( x ), pow( x , y ) - exponential and power functions (x to the power of y)
sin( x ), cos( x ), tan( x ) - trigonometric functions
asin( x ), acos( x ), atan( x ), - inverse trigonometric functions
atan2( y , x ) - four-quadrant inverse tangent
sinh( x ), cosh( x ), tanh( x ) - hyperbolic functions
asinh( x ), acosh( x ), atanh( x ) - inverse hyperbolic functions
fact( x ) - factorial

random( ) - random number between 0 and 32767
isnan( x ), isinf( x ) - tests for not-a-number and infinity

Re: math ability

Posted: Sun Aug 31, 2014 9:53 pm
by hefin
I've just downloaded the trial version of Flowcode v6.I tried to use the Calculation component but got a compiling error when I entered tanh().Simmilarly with sinh()
Why is this?
I circumvented the problem by the successful use of exp(). Is this an intended limitation of the trial version?

Re: math ability

Posted: Mon Sep 01, 2014 5:30 pm
by Benj
I've just downloaded the trial version of Flowcode v6.I tried to use the Calculation component but got a compiling error when I entered tanh().Simmilarly with sinh()
Why is this?
I circumvented the problem by the successful use of exp(). Is this an intended limitation of the trial version?
The 8-bit PIC version of Flowcode supports Float variables but not the float functions such as tan and tanh. We are currently looking into switching compilers for 8-bit PIC to remove this problem.

All other variants of Flowcode, ARM, AVR and 16-bit PIC should work fine with the floating point functions.

Re: math ability

Posted: Tue Mar 17, 2015 10:09 pm
by stuart randall
Hi Ben, this is something I'm having trouble with now. I see that its been about 6 months with this post and I was wondering if there have been any developments with it?

Thanks

Re: math ability

Posted: Wed Mar 18, 2015 12:09 pm
by Benj
Hello Stuart,

No this compiler change has now been pushed back to Flowcode 7 which is still a fair way off. Can you switch to another microcontroller family for now?

Re: math ability

Posted: Wed Mar 18, 2015 7:11 pm
by stuart randall
I could do. I'm currently using a 16F1937. Is there a similar device you can recommend?

Re: math ability

Posted: Thu Mar 19, 2015 5:34 pm
by Benj
Hello Stuart,

How about a ATMEGA328P (chip used commonly on Arduino) or a dsPIC33EP device (same family as we use on the ECIO40P16 device).