Created
December 30, 2013 04:30
-
-
Save moogoo78/8177830 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun run-calc (d hh mm ss) | |
"running calculator" | |
(interactive "nDistance (km): \nnHours: \nnMinutes: \nnSeconds: ") | |
(let ((km (* d 1000)) | |
(tm (+ (* hh 3600) (* mm 60) ss))) | |
(setq hkm (/ tm d 60.0)) | |
(setq hkm-m (/ tm d 60)) | |
(setq hkm-s (% (/ tm d) 60)) | |
(setq mpr (/ tm d 2.5))) ;;沒有進位 | |
(message "%dkm, %02d:%02d:%02d => %.2f m/km (%dm%ds), %.2f s/round" d hh mm ss hkm hkm-m hkm-s mpr) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment