Calculator broken in DEG mode for ASIN, ACOS

In DEG mode, the QNX desk calculator returns the following

ASIN of 0.0 = 0 (correct)
ACOS of 0.0 = 1.570796 (WRONG, should be 90 degrees)
ASIN of 1.0 = 0.017454 (WRONG, should be 90 degrees)
ACOS of 1.0 = 1.553342 (WRONG, should be 0 degrees)

in RAD mode

ASIN of 0.0 = 0 (correct)
ACOS of 0.0 = 1.570796 (which is pi/2, and correct)
ASIN of 1.0 = 1.553342 (which is pi/2, and correct)
ACOS of 1.0 = 0 (correct)

It’s clear what’s wrong. The program is applying the degrees-to-radians
conversion to the INPUT of ASIN and ACOS, rather than the output.

This caused us to miscalculate the maximum terrain slope the Overbot
could traverse. But we caught it in simulation testing.

[QNX 6.21 PE]

John Nagle
Team Overbot

John Nagle <nagle@overbot.com> wrote:

Yup, reproduced in 6.3.0 SP2, and I’ve issued a PR, 27158,
against it.

-David

In DEG mode, the QNX desk calculator returns the following

ASIN of 0.0 = 0 (correct)
ACOS of 0.0 = 1.570796 (WRONG, should be 90 degrees)
ASIN of 1.0 = 0.017454 (WRONG, should be 90 degrees)
ACOS of 1.0 = 1.553342 (WRONG, should be 0 degrees)

in RAD mode

ASIN of 0.0 = 0 (correct)
ACOS of 0.0 = 1.570796 (which is pi/2, and correct)
ASIN of 1.0 = 1.553342 (which is pi/2, and correct)
ACOS of 1.0 = 0 (correct)

It’s clear what’s wrong. The program is applying the degrees-to-radians
conversion to the INPUT of ASIN and ACOS, rather than the output.

This caused us to miscalculate the maximum terrain slope the Overbot
could traverse. But we caught it in simulation testing.

[QNX 6.21 PE]

John Nagle
Team Overbot


David Gibbs
QNX Training Services
dagibbs@qnx.com

Did you do a search first? PR8710 seems to be complaining about the
same thing. (BTW I just fixed it.)

David Gibbs wrote:

John Nagle <> nagle@overbot.com> > wrote:

Yup, reproduced in 6.3.0 SP2, and I’ve issued a PR, 27158,
against it.

-David


In DEG mode, the QNX desk calculator returns the following


ASIN of 0.0 = 0 (correct)
ACOS of 0.0 = 1.570796 (WRONG, should be 90 degrees)
ASIN of 1.0 = 0.017454 (WRONG, should be 90 degrees)
ACOS of 1.0 = 1.553342 (WRONG, should be 0 degrees)


in RAD mode


ASIN of 0.0 = 0 (correct)
ACOS of 0.0 = 1.570796 (which is pi/2, and correct)
ASIN of 1.0 = 1.553342 (which is pi/2, and correct)
ACOS of 1.0 = 0 (correct)


It’s clear what’s wrong. The program is applying the degrees-to-radians
conversion to the INPUT of ASIN and ACOS, rather than the output.


This caused us to miscalculate the maximum terrain slope the Overbot
could traverse. But we caught it in simulation testing.


[QNX 6.21 PE]


John Nagle
Team Overbot

Wojtek Lerch <Wojtek_L@yahoo.ca> wrote:

Did you do a search first? PR8710 seems to be complaining about the
same thing. (BTW I just fixed it.)

I searched on “phcalc”, which didn’t throw up anything that matched.

I guess you should mark 27158 as a duplicate of 8710.

-David

David Gibbs wrote:
John Nagle <> nagle@overbot.com> > wrote:

Yup, reproduced in 6.3.0 SP2, and I’ve issued a PR, 27158,
against it.

-David


In DEG mode, the QNX desk calculator returns the following


ASIN of 0.0 = 0 (correct)
ACOS of 0.0 = 1.570796 (WRONG, should be 90 degrees)
ASIN of 1.0 = 0.017454 (WRONG, should be 90 degrees)
ACOS of 1.0 = 1.553342 (WRONG, should be 0 degrees)


in RAD mode


ASIN of 0.0 = 0 (correct)
ACOS of 0.0 = 1.570796 (which is pi/2, and correct)
ASIN of 1.0 = 1.553342 (which is pi/2, and correct)
ACOS of 1.0 = 0 (correct)


It’s clear what’s wrong. The program is applying the degrees-to-radians
conversion to the INPUT of ASIN and ACOS, rather than the output.


This caused us to miscalculate the maximum terrain slope the Overbot
could traverse. But we caught it in simulation testing.


[QNX 6.21 PE]


John Nagle
Team Overbot
\


David Gibbs
QNX Training Services
dagibbs@qnx.com