Opened 14 years ago

Closed 13 years ago

#6398 closed enhancement (fixed)

Transcendental Functions return 0 instead of an error when result is out of range

Reported by: jscipione Owned by: stippi
Priority: normal Milestone: R1
Component: Applications/DeskCalc Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

The transcendental functions acos(), asin(), ln(), log(), and sqrt() all return 0 when the result is out of range. For instance acos(-2) returns 0 as does ln(-1) and sqrt(-5). I have included a patch that throws an "out of domain" exception for these functions rather than returning 0. This fixes the immediate bug. However, a nice enhancement would be to gracefully handle infinite and irrational results rather than just erroring.

Attachments (1)

deskcalc_out_of_range.patch (1.6 KB ) - added by jscipione 14 years ago.
patch to error when result is out of range (input out of domain)

Download all attachments as: .zip

Change History (6)

by jscipione, 14 years ago

Attachment: deskcalc_out_of_range.patch added

patch to error when result is out of range (input out of domain)

comment:1 by jscipione, 14 years ago

patch: 01

comment:2 by jscipione, 13 years ago

Summary: Transcendental Functions return 0 instead of an error if result is out of rangeTranscendental Functions return 0 instead of an error when result is out of range
Type: bugenhancement

comment:3 by jscipione, 13 years ago

Please apply patch before R1/Alpha3

comment:4 by stippi, 13 years ago

Status: newin-progress

comment:5 by stippi, 13 years ago

Resolution: fixed
Status: in-progressclosed

Thanks a bunch and sorry for the delay. Applied in hrev39889. Since the bug is not in some system library, but in MAPM, I would consider the problem fixed.

Note: See TracTickets for help on using tickets.