GNU bug report logs - #74760
29.4; Calc : calcFunc-rate does not produce negative results

Previous Next

Package: emacs;

Reported by: Ting Boon Ghee <tingbg <at> gmail.com>

Date: Tue, 10 Dec 2024 05:11:02 UTC

Severity: normal

Found in version 29.4

Full log


View this message in rfc822 format

From: Ting Boon Ghee <tingbg <at> gmail.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 74760 <at> debbugs.gnu.org
Subject: bug#74760: 29.4; Calc : calcFunc-rate does not produce negative results
Date: Wed, 11 Dec 2024 02:40:34 +0800
[Message part 1 (text/plain, inline)]
Thanks everyone for response.

These financial functions (and more) are available in spreadsheets such as
Libreoffice Calc. There is no restriction for Rate to be negative in
Libreoffice Calc. One way to look at this is, from investment perspective,
it just means the series of payments is less than the initial outlay,
resulting in negative return.

The Info manual describes the Rate function as an inverse of ‘pv’:
‘rate(N, PAYMENT, AMOUNT)’ computes the value of RATE such that ‘pv(RATE,
N, PAYMENT) = AMOUNT’. So let's try PV.

If Rate = -0.1, N = 1, PAYMENT = 90, calculate PV. Thus,

M-x calc <RET> _0.1 <RET> 1 <RET> 90 <RET> b P
Answer : 100

This means PV function can accept Rate as a negative number.

I stumbled upon this issue because I was trying to recreate a table that I
had done previously in Libreoffice Calc into an Org Table. The table uses
Rate function to calculate a series of returns with a range of negative to
positive returns. The negative returns generated errors in the table fields.

I suppose Emacs Calc was developed long ago to mimic handheld calculators.
I'd wonder whether anyone is still using it as a "handheld" financial
calculator. Such functions are most useful in spreadsheets. Emacs now has
an implementation of a spreadsheet in the form of Org Table that uses Emacs
Calc. This does mean that it is restricted to what Emacs Calc can provide.
A missing function that I wish for is the XIRR function available in other
spreadsheet softwares.

-- 
Best regards,
Boon Ghee
[Message part 2 (text/html, inline)]

This bug report was last modified 189 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.