mB 5.0.0.3 beta 4 : CosE3 help file

Discuss about beta versions of mikroBasic
compiler.
Post Reply
Author
Message
Kalain
Posts: 1093
Joined: 11 Mar 2005 18:26
Location: Aubenas, France

mB 5.0.0.3 beta 4 : CosE3 help file

#1 Post by Kalain » 21 Sep 2007 23:46

Hi,

Here is below a copy of help file about CosE3 function :
Ceil
Prototype sub function Ceil(dim x as float) as float

Description Function returns value of parameter num rounded up to the next whole number.

CosE3
Prototype sub function CosE3(dim x as word) as integer

Description Function takes parameter x which represents angle in degrees, and returns its cosine multiplied by 1000 and rounded up to the nearest integer:

result = round_up(cos(x)*1000)The function is implemented as a lookup table; maximum error obtained is ±1.
In CosE3, an example is given but "round_up" function doesn't exist.
CosE3 example should refer to Ceil function ?
Alain

User avatar
milan
mikroElektronika team
Posts: 1013
Joined: 04 May 2006 16:36
Contact:

Re: mB 5.0.0.3 beta 4 : CosE3 help file

#2 Post by milan » 24 Sep 2007 11:37

Hi,
Kalain wrote: In CosE3, an example is given but "round_up" function doesn't exist.
CosE3 example should refer to Ceil function ?
This is pseudo code, it is used just for explanation. Thank you for your report.

BTW: we made a correction for the next release. "rounded up" will be replaced with "rounded".

Kalain
Posts: 1093
Joined: 11 Mar 2005 18:26
Location: Aubenas, France

Re: mB 5.0.0.3 beta 4 : CosE3 help file

#3 Post by Kalain » 24 Sep 2007 12:43

milan wrote:Hi,
This is pseudo code, it is used just for explanation. Thank you for your report.
This is more than pseudo code which is given in help file.

Code: Select all

result = round_up(cos(x)*1000)
BTW: we made a correction for the next release. "rounded up" will be replaced with "rounded".
What about "Ceil" function ? It does also the job ?
Alain

User avatar
milan
mikroElektronika team
Posts: 1013
Joined: 04 May 2006 16:36
Contact:

Re: mB 5.0.0.3 beta 4 : CosE3 help file

#4 Post by milan » 24 Sep 2007 15:26

Hi,
Kalain wrote: What about "Ceil" function ? It does also the job ?
No. The CosE3 function is implemented as a lookup table.

Kalain
Posts: 1093
Joined: 11 Mar 2005 18:26
Location: Aubenas, France

#5 Post by Kalain » 24 Sep 2007 18:24

Hi,

Excuse me to insist but in CosE3 example it's written :

Code: Select all

result = round_up(cos(x)*1000) 
If I refer at Ceil function (and if I understand correctly this function), CosE3 example should be written as (?) :

Code: Select all

result = Ceil(cos(x)*1000) 
Alain

User avatar
milan
mikroElektronika team
Posts: 1013
Joined: 04 May 2006 16:36
Contact:

#6 Post by milan » 25 Sep 2007 08:31

Hi,

there is some confusion here.

1. There is an error in Help, "rounded up" will be replaced with "rounded"

2. In the example result = round_up(cos(x)*1000) will be replaced with
result = round(cos(x)*1000)

3. So Ceil function can not be used to describe CosE3 function.

4. CosE3 doesn't use Ceil function, CosE3 is lookup table, it works with integers and it is faster.

5. Ceil function works with floats and it is slower.

Post Reply

Return to “mikroBasic Beta testing”