From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miguel Ruiz Subject: Bug: Babel calc sqrt float var Date: Tue, 10 Dec 2013 10:43:02 +0000 (GMT) Message-ID: <1386672182.64210.YahooMailNeo@web171906.mail.ir2.yahoo.com> Reply-To: Miguel Ruiz Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="-1899948411-890409392-1386672182=:64210" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqKmW-0007zW-PI for emacs-orgmode@gnu.org; Tue, 10 Dec 2013 05:43:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqKmP-0006KS-Jx for emacs-orgmode@gnu.org; Tue, 10 Dec 2013 05:43:12 -0500 Received: from nm25-vm4.bullet.mail.ir2.yahoo.com ([212.82.97.37]:23945) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1VqKmP-0006KJ-6z for emacs-orgmode@gnu.org; Tue, 10 Dec 2013 05:43:05 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" ---1899948411-890409392-1386672182=:64210 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi,=0A=0APlease, I am communicating the following problematic behaviour:=0A= =0A#------------------- problematic code ------------------------=0A#+begin= _src calc=A0=0A=0Asqrt(0.8)=0A#+end_src=0A=0A#+RESULTS:=0A: 0.894427191 # O= K=0A=0A#+begin_src calc :var x=3D0.8=0Asqrt(x)=0A#+end_src=0A=0A#+RESULTS:= =0A=3DDebugger entered--Lisp error: (wrong-type-argument integer-or-marker-= p 0.80000000000000004)=0A=A0 math-idivmod(0.80000000000000004 0.80000000000= 000004)=0A=A0 math-div(0.80000000000000004 0.80000000000000004)=0A=A0 math-= cancel-common-factor(0.80000000000000004 0.80000000000000004)=0A=A0 math-si= mplify-sqrt()=0A=A0 #[(math-simplify-expr) "\300 \207" [math-simplify-sqrt]= 1]((calcFunc-sqrt 0.80000000000000004))=0A=A0 math-simplify-step((calcFunc= -sqrt 0.80000000000000004))=0A=A0 math-simplify((calcFunc-sqrt 0.8000000000= 0000004))=0A=A0 calc-normalize-fancy((calcFunc-sqrt 0.80000000000000004))= =0A=A0 calc-normalize((calcFunc-sqrt 0.80000000000000004))=0A=A0 math-evalu= ate-expr((calcFunc-sqrt 0.80000000000000004))=0A=A0 #[(line) "=0A=A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 not copy-yank-able string=0A=A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 "=0A[line var-names calc-mode-map res x 0 calc-recall i= ntern 1 "'" lookup-key nil calc-push-list calc-eval math-read-number error = "Calc error \"%s\" on input \"%s\"" replace-regexp-in-string "" math-evalua= te-expr mapcar org-babel-calc-maybe-resolve-var math-read-exprs] 11] ("sqrt= (x)"))=0A=A0 org-babel-execute:calc("sqrt(x)" ((:comments . "") (:shebang .= "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exp= orts . "code") (:results . "replace") (:var x . 0.80000000000000004) (:sess= ion . "none") (:hlines . "no") (:result-type . value) (:result-params "repl= ace") (:rowname-names) (:colname-names)))=0A=A0 org-babel-execute-src-block= (nil)=0A=A0 org-babel-execute-src-block-maybe()=0A=A0 org-babel-execute-may= be()=0A=A0 org-babel-execute-safely-maybe()=0A=A0 run-hook-with-args-until-= success(org-babel-execute-safely-maybe)=0A=A0 org-ctrl-c-ctrl-c(nil)=0A=A0 = call-interactively(org-ctrl-c-ctrl-c nil nil)=0A=0A=0A#--------------------= -- end of problematic code --------------------------------=0A=0ACommand li= ne: emacs -Q -l minimal-org.el=0A=0A;;; minimal-org.el:=0A;;; Minimal setup= to load latest `org-mode'=0A=A0 =A0 =A0=0A;; activate debugging=0A(setq de= bug-on-error t=0A=A0 =A0 =A0 debug-on-signal nil=0A=A0 =A0 =A0 debug-on-qui= t nil)=0A=A0 =A0 =A0=0A;; add latest org-mode to load path=0A(add-to-list '= load-path (expand-file-name "~/org-mode/maint/lisp"))=0A(add-to-list 'load-= path (expand-file-name "~/org-mode/maint/contrib/lisp" t))=0A=0A;; active B= abel languages=0A(org-babel-do-load-languages=0A=A0'org-babel-load-language= s=0A=A0'((calc . t)))=0A=0A;;; end of minimal-org.el=0A=0AGNU Emacs 24.3.1 = (i686-pc-cygwin) of 2013-08-14 on moufang=0A=0AOrg-mode version 8.2.4 (rele= ase_8.2.4-3-g7fe99a @ /home/usuario/org-mode/maint/lisp/)=0A=0A=0ATIA.=0AMi= guel Ruiz. ---1899948411-890409392-1386672182=:64210 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

Please, I a= m communicating the following problematic behaviour:

#---------= ---------- problematic code ------------------------
#+begin_src calc=  
sqrt(0.8)
#+end_src

#+RESULTS:
: 0.894427191 # OK

#+= begin_src calc :var x=3D0.8
sqrt(x)
#+end_src

#+RESULTS:
=3DDebugger entered--Lisp error: (wron= g-type-argument integer-or-marker-p 0.80000000000000004)
  m= ath-idivmod(0.80000000000000004 0.80000000000000004)
  math-div(0.80000000000000004 0.80000000000000004)
  math-ca= ncel-common-factor(0.80000000000000004 0.80000000000000004)
 = ; math-simplify-sqrt()
  #[(math-simplify-expr) "\300 \207" = [math-simplify-sqrt] 1]((calcFunc-sqrt 0.80000000000000004))
&nbs= p; math-simplify-step((calcFunc-sqrt 0.80000000000000004))
 = math-simplify((calcFunc-sqrt 0.80000000000000004))
  calc-n= ormalize-fancy((calcFunc-sqrt 0.80000000000000004))
  calc-n= ormalize((calcFunc-sqrt 0.80000000000000004))
  math-evaluat= e-expr((calcFunc-sqrt 0.80000000000000004))
  #[(line) "
                  not c= opy-yank-able string
                          &nbs= p;                     &n= bsp;       "
[line var-names calc-mode-map res x 0 calc-recall intern 1 "'" lookup-k= ey nil calc-push-list calc-eval math-read-number error "Calc error \"%s\" o= n input \"%s\"" replace-regexp-in-string "" math-evaluate-expr mapcar org-b= abel-calc-maybe-resolve-var math-read-exprs] 11] ("sqrt(x)"))
  org-babel-execute:calc("sqrt(x= )" ((:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:nowe= b . "no") (:tangle . "no") (:exports . "code") (:results . "replace") (:var= x . 0.80000000000000004) (:session . "none") (:hlines . "no") (:result-typ= e . value) (:result-params "replace") (:rowname-names) (:colname-names)))
  org-babel-execute-src-block(nil)
  org-babel-execute-src-block-maybe()
  org-babel-execute-maybe()
  org-babel-execute-safely-maybe= ()
  run-hook-with-= args-until-success(org-babel-execute-safely-maybe)
  org-ctrl-c-ctrl-c(nil)
  call-interactively(org-ctrl-c-ctrl-= c nil nil)

Command li= ne: emacs -Q -l minimal-org.el

;;; minimal-org.el:
     
;; activate debugging
(setq debug-on-error t
      debug-on-signal nil
      debug-on-quit nil)
     
=
;; add latest org-mode to load pa= th
(add-to-list 'load-pa= th (expand-file-name "~/org-mode/maint/lisp"))
(add-to-list 'load-path (expand-file-name "~/org-mod= e/maint/contrib/lisp" t))
;; active Babel l= anguages
(org-babel-do-l= oad-languages
 'org= -babel-load-languages
&n= bsp;'((calc . t)))

<= /div>
;;; end of minimal-org.e= l

GNU Emacs 24.3.1 (i686-pc-cygwin) of 2013-08-14 on moufang
Org-mode version 8.2.4 (release_8= .2.4-3-g7fe99a @ /home/usuario/org-mode/maint/lisp/)

TIA.
Mi= guel Ruiz.
---1899948411-890409392-1386672182=:64210--