Function pow (x,y)

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Post Reply
User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

Function pow (x,y)

Post by Alan_37 »

Just found a bug in the pow Function

result = pow (x,y)

pow (2,0) = 1 (ok )
pow (2,1) = 2 ( ok )
pow (2,2) = 3 ( ? )
pow (2,3) = 7 ( ? )

if y is greater than 1 the result is wrong by -1

I resolved this by doing if ( y > 1) {result = result +1 } but i think it is still u bug .
Last edited by Alan_37 on Wed Jul 08, 2020 12:31 pm, edited 1 time in total.

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

Re: Function pow (x,y)

Post by Benj »

Hi Alan,

Thanks for sharing, which chip pack are you finding this on? Is it also a problem in the simulation?

User avatar
Alan_37
Posts: 179
Joined: Sun May 01, 2016 8:36 pm
Has thanked: 51 times
Been thanked: 54 times
Contact:

Re: Function pow (x,y)

Post by Alan_37 »

Hi Benj ,

chip is Atmega2560, in the simulation work fine.

Post Reply