math ability

Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

tinker
Flowcode V4 User
Posts: 8
Joined: Mon Jul 02, 2007 9:35 am
Contact:

math ability

Postby tinker » Thu Jun 19, 2008 9:13 pm

Hi all
is there a list specifying what math functions are available in flowcode ?

cheers
joe

User avatar
Benj
Matrix Staff
Posts: 14321
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4412 times
Been thanked: 4129 times
Contact:

Re: math ability

Postby Benj » Fri Jun 20, 2008 9:45 am

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

hefin
Posts: 1
Joined: Sun Aug 31, 2014 9:40 pm
Contact:

Re: math ability

Postby hefin » Sun Aug 31, 2014 9:53 pm

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?

User avatar
Benj
Matrix Staff
Posts: 14321
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4412 times
Been thanked: 4129 times
Contact:

Re: math ability

Postby Benj » Mon Sep 01, 2014 5:30 pm

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.
These users thanked the author Benj for the post:
Rudi (Tue Sep 02, 2014 10:47 am)
Rating: 5.26%
 

stuart randall
Posts: 4
Joined: Sun Mar 01, 2015 2:07 pm
Contact:

Re: math ability

Postby stuart randall » Tue Mar 17, 2015 10:09 pm

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

User avatar
Benj
Matrix Staff
Posts: 14321
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4412 times
Been thanked: 4129 times
Contact:

Re: math ability

Postby Benj » Wed Mar 18, 2015 12:09 pm

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?

stuart randall
Posts: 4
Joined: Sun Mar 01, 2015 2:07 pm
Contact:

Re: math ability

Postby stuart randall » Wed Mar 18, 2015 7:11 pm

I could do. I'm currently using a 16F1937. Is there a similar device you can recommend?

User avatar
Benj
Matrix Staff
Posts: 14321
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4412 times
Been thanked: 4129 times
Contact:

Re: math ability

Postby Benj » Thu Mar 19, 2015 5:34 pm

Hello Stuart,

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