Skip navigation

While in emacs I’m getting used to a quick way to make arithmetic calculations by evaluating an expression. In the need to sum two numbers I can do for example “M-: (+ 3447 3834)” and see the result in the minibuffer! (in the same fashion you use – * or / as preceding the arguments for subtracting, multiplying or dividing)
A worth remembering tip -not so obvious to me at first- is that to get a floating-numbers result you need to feed at least one of the argument of the expression in a decimal format. This means that (/ 100 3) will return 33 unless you put for example (/ 100 3.0) to get 33.333333333333336

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: