You are not logged in.
Hi,
I would like to operate some calculations about DMS/HMS. (Degree/Hour Minute Seconds)
I use the calc package, so in order to discover how to use it (and if it's possible) I do some research in man page.
user@alaanor ~> calc
C-style arbitrary precision calculator (version 2.12.5.3)
Calc is open software. For license details type: help copyright
[Type "exit" to exit, or "help" for help.]
; help obj
This page explain that some object exist with predefined function, for HMS or DMS the .cal file are stored into /usr/share/calc/[hms/dms].cal
Those files contains only a suit of function and an object prototype declaration.
Hoverer it's doesn't explain me how to use it. >_< So, maybe I'm a bit dumb and I missed something.
; hms
"hms" is undefined
; hms(2, 30, 0)
Function "hms" is undefined
; hms_print(0);
Function "hms_print" is undefined
hms_print is a function declared into /usr/share/calc/hms.cal
Did I misunderstood something ? (I hope)
Last edited by Alaanor (2017-04-09 11:29:15)
Offline
$ calc
C-style arbitrary precision calculator (version 2.12.5.3)
Calc is open software. For license details type: help copyright
[Type "exit" to exit, or "help" for help.]
; read hms
hms(hour,min,sec) defined
hms_add(a,b) defined
hms_neg(a) defined
hms_sub(a,b) defined
hms_mul(a,b) defined
hms_print(a) defined
hms_abs(a) defined
hms_norm(a) defined
hms_test(a) defined
hms_int(a) defined
hms_frac(a) defined
hms_rel(a,b) defined
hms_cmp(a,b) defined
hms_inc(a) defined
hms_dec(a) defined
fixhms(a) defined
obj hms {hour, min, sec} defined
;
Offline
Ho, yeah. It's work.
But you didn't explain how to use it u_u.
You just prove those object are defined.
(Yes, this time I'm a noob è_é)
Last edited by Alaanor (2017-04-09 10:43:20)
Offline
$ calc
C-style arbitrary precision calculator (version 2.12.5.3)
Calc is open software. For license details type: help copyright
[Type "exit" to exit, or "help" for help.]
; read hms
hms(hour,min,sec) defined
hms_add(a,b) defined
hms_neg(a) defined
hms_sub(a,b) defined
hms_mul(a,b) defined
hms_print(a) defined
hms_abs(a) defined
hms_norm(a) defined
hms_test(a) defined
hms_int(a) defined
hms_frac(a) defined
hms_rel(a,b) defined
hms_cmp(a,b) defined
hms_inc(a) defined
hms_dec(a) defined
fixhms(a) defined
obj hms {hour, min, sec} defined
; a=hms(1,2,3)
; b=hms(4,5,6)
; c=hms_add(a,b)
; hms_print(c)
5:7:9;
Have you examined the source /usr/share/calc/hms.cal if you do not know what the functions do?
Offline
Hoooo, finally I understand it !
I have to load the module to get function defined each time.
Any way to load all of them automatically at each start ?
Offline
$ cat ~/.calcrc
read hms
$ calc
C-style arbitrary precision calculator (version 2.12.5.3)
Calc is open software. For license details type: help copyright
[Type "exit" to exit, or "help" for help.]
hms(hour,min,sec) defined
hms_add(a,b) defined
hms_neg(a) defined
hms_sub(a,b) defined
hms_mul(a,b) defined
hms_print(a) defined
hms_abs(a) defined
hms_norm(a) defined
hms_test(a) defined
hms_int(a) defined
hms_frac(a) defined
hms_rel(a,b) defined
hms_cmp(a,b) defined
hms_inc(a) defined
hms_dec(a) defined
fixhms(a) defined
obj hms {hour, min, sec} defined
;
Offline
Thanks you for all !
Offline