[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #46598] unable to get single eps when specifyi
From: |
Carnë Draug |
Subject: |
[Octave-bug-tracker] [bug #46598] unable to get single eps when specifying class |
Date: |
Thu, 03 Dec 2015 13:04:40 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.4.0 |
URL:
<http://savannah.gnu.org/bugs/?46598>
Summary: unable to get single eps when specifying class
Project: GNU Octave
Submitted by: carandraug
Submitted on: Thu 03 Dec 2015 13:04:40 GMT
Category: Octave Function
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: dev
Operating System: Any
_______________________________________________________
Details:
The eps function has the following interface:
-- Built-in Function: eps
-- Built-in Function: eps (X)
-- Built-in Function: eps (N, M)
-- Built-in Function: eps (N, M, K, ...)
-- Built-in Function: eps (..., CLASS)
However, it is not possible to use "eps (X, CLASS)" because it thinks we are
calling "eps (N, CLASS)"
Example:
octave> eps (5)
ans = 8.8818e-16
octave> eps (5, "double")
ans =
2.2204e-16 2.2204e-16 2.2204e-16 2.2204e-16 2.2204e-16
2.2204e-16 2.2204e-16 2.2204e-16 2.2204e-16 2.2204e-16
2.2204e-16 2.2204e-16 2.2204e-16 2.2204e-16 2.2204e-16
2.2204e-16 2.2204e-16 2.2204e-16 2.2204e-16 2.2204e-16
2.2204e-16 2.2204e-16 2.2204e-16 2.2204e-16 2.2204e-16
octave> eps (5, "single")
ans =
1.1921e-07 1.1921e-07 1.1921e-07 1.1921e-07 1.1921e-07
1.1921e-07 1.1921e-07 1.1921e-07 1.1921e-07 1.1921e-07
1.1921e-07 1.1921e-07 1.1921e-07 1.1921e-07 1.1921e-07
1.1921e-07 1.1921e-07 1.1921e-07 1.1921e-07 1.1921e-07
1.1921e-07 1.1921e-07 1.1921e-07 1.1921e-07 1.1921e-07
So in order to actually get 'eps (5, "single")', one needs to do
octave> eps (single (5))
ans = 4.7684e-07
I'm not sure if this should be a mistake of the documentation or if we should
change the function to always require the X argument. Also, the documentation
does not make it obvious that 'eps (CLASS)' is valid (but I can see how the
ellipsis in 'eps (..., CLASS)' includes the just eps()).
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?46598>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #46598] unable to get single eps when specifying class,
Carnë Draug <=