From: SourceForge.net <no...@so...> - 2007-06-04 17:23:46
|
Bugs item #1729432, was opened at 2007-06-01 07:32 Message generated for change (Comment added) made by willisbl You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1729432&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core Group: Includes proposed fix >Status: Closed >Resolution: Fixed Priority: 4 Private: No Submitted By: Barton Willis (willisbl) Assigned to: Nobody/Anonymous (nobody) Summary: onep1 / FIX Initial Comment: The function onep1 compares a big float to bigfloatone. But the value of bigfloatone depends on fpprec; so (%i1) fpprec : 20$ (%i2) x : 1.0b0$ (%i3) ?onep1(x); (%o3) true (%i4) fpprec : 21$ (%i5) ?onep1(x); (%o5) false The function zerop1 doesn't have this problem (but zerop1 shouldn't have call alike1). Also, I think that ?onep1(rat(1)) should be true. ---------------------------------------------------------------------- >Comment By: Barton Willis (willisbl) Date: 2007-06-04 12:23 Message: Logged In: YES user_id=895922 Originator: YES Suggest fix applied -- see simp.lisp CVS revision 1.39 ---------------------------------------------------------------------- Comment By: Barton Willis (willisbl) Date: 2007-06-01 22:14 Message: Logged In: YES user_id=895922 Originator: YES Proposed code: (defun $bfloatp (x) (and (consp x) (consp (car x)) (eq (caar x) 'bigfloat))) (defun zerop1 (x) (or (and (integerp x) (= 0 x)) (and (floatp x) (= 0.0 x)) (and ($bfloatp x) (= 0 (second x))))) (defun onep1 (x) (or (and (integerp x) (= 1 x)) (and (floatp x) (= 1.0 x)) (and ($bfloatp x) (zerop1 (sub x 1))))) The new bfloat code is needed because onep1 sometimes recieves an invalid expressions (from taylor, perhaps). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1729432&group_id=4933 |