From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marco Parrone Newsgroups: gmane.emacs.help Subject: Re: Evaluation of "standard" style math expresssions. Date: Tue, 21 Sep 2004 12:07:56 GMT Organization: none Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87vfe7u8sw.fsf@autistici.org> References: <20040921114408.GA2296@matijek.plusseven.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1095768554 10359 80.91.229.6 (21 Sep 2004 12:09:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Sep 2004 12:09:14 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 21 14:09:09 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C9jSH-0000jt-00 for ; Tue, 21 Sep 2004 14:09:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C9jYC-00065U-GQ for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Sep 2004 08:15:16 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news-out.tin.it!news-in.tin.it!news3.tin.it.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Language: en X-Accept-Language: it, en X-Country: Italy X-Attribution: Marco X-Face: ]KIe+0@lNbQo2y\ey;]!*LKsR-0$V737yt[BnA*)c,)gu>IH>S}:"PPNWkV<}[ usLa_gJyB!BRUEC!~5OY;:`k1Tcv2g2<0|,'RI}ZhnPpaXC.,L^y?}R&FfrRiLE*b+AE, JY/a! `/ZN{E`NgLO_QV#s`!,#M%ppv@mcIb`K^/1``d^=o"AvteN1nNFyzU List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20789 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20789 Alex Polite on 21 Sep 2004 11:48:13 GMT writes: > I know how to evaluate mathematical expressions expressed in lisp in > any emacs buffer. (eg (+ 17 42)) > > But I'd like to be able to eval expression where the notation is the > kind you learn in school (eg (17 + 42)) > > How do I do it? you can pipe the expression to bc. for example on a line you have 1 + 2 * 3 you can set the mark `C-SPC' at the beginning of the line, then move the point in the next line `C-n', then pipe the line to bc `M-| bc RET' try with 9 / 2 you get 4, you may want to do this instead scale=1 9 / 2 (set the mark at the beginning of the first line and move the point after the second), so to get `4.5'. for more informations about bc syntax, do `M-x man RET bc RET'. -- Marco Parrone fingerprint: F7D4 527B DE97 4090 657B 6E4E 8B63 1167 (4507 0AD6)