mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Added several conversion funcions, plus minor updates
Added several conversion functions: Added builtin functions to convert between degrees and degrees, minutes and seconds under the config("mod") round rules: d2dms(degs, d, m, s [,rnd]) - given degs, compute d, m, s d2dm(degs, d, m [,rnd]) - given degs, compute d, m See help/d2dms and help/d2dm. Example: ; print d2dms(360.321,deg=,min=,sec=), deg, min, sec; 0.321 0 19 15.6 ; print d2dm(360.321,deg=,min=), deg, min; 0.321 0 19.26 Added builtin functions to convert between gradians and gradians, minutes and seconds under the config("mod") round rules: g2gms(grads, g, m, s [,rnd]) - given grads, compute g, m, s g2gm(grads, g, m [,rnd]) - given grads, compute g, m See help/g2gms and help/g2gm. Example: ; print g2gms(400.321,grad=,min=,sec=), grad, min, sec; 0.321 0 19 15.6 ; print g2gm(400.321,grad=,min=), grad, min; 0.321 0 19.26 Added builtin functions to convert between hours and hours, minutes and seconds under the config("mod") round rules: h2hms(hours, h, m, s [,rnd]) - given hours, compute h, m, s h2hm(hours, h, m [,rnd]) - given hours, compute h, m See help/h2hms and help/h2hm. Example: ; print h2hms(24.321,hour=,min=,sec=), hour, min, sec; 0.321 0 19 15.6 ; print h2hm(24.321,hour=,min=), hour, min; 0.321 0 19.26 In addtion: Renumbered regression tests 3408 thru 3437, to 9102 thru 9131. Updated Added hms.cal resource file to use h2hms() builtin. Updated Added dms.cal resource file to use d2dms() builtin. Fix minor typo in help/mod SYNOPSIS. Fix minor typo in help/quo SYNOPSIS. Added a few more examples to help/strcmp.
This commit is contained in:
7
zmath.c
7
zmath.c
@@ -58,6 +58,9 @@ HALF _twentyval_[] = { 20 };
|
||||
HALF _sqbaseval_[] = { 0, 1 };
|
||||
HALF _pow4baseval_[] = { 0, 0, 1 };
|
||||
HALF _pow8baseval_[] = { 0, 0, 0, 0, 1 };
|
||||
HALF _threesixtyval_[] = { 360 };
|
||||
HALF _fourhundredval_[] = { 400 };
|
||||
HALF _twentyfourval_[] = { 24 };
|
||||
|
||||
ZVALUE zconst[] = {
|
||||
{ _zeroval_, 1, 0}, { _oneval_, 1, 0}, { _twoval_, 1, 0},
|
||||
@@ -66,7 +69,9 @@ ZVALUE zconst[] = {
|
||||
{ _nineval_, 1, 0}, { _tenval_, 1, 0}, { _elevenval_, 1, 0},
|
||||
{ _twelveval_, 1, 0}, { _thirteenval_, 1, 0}, { _fourteenval_, 1, 0},
|
||||
{ _fifteenval_, 1, 0}, { _sixteenval_, 1, 0}, { _seventeenval_, 1, 0},
|
||||
{ _eightteenval_, 1, 0}, { _nineteenval_, 1, 0}, { _twentyval_, 1, 0}
|
||||
{ _eightteenval_, 1, 0}, { _nineteenval_, 1, 0}, { _twentyval_, 1, 0},
|
||||
{ _threesixtyval_, 1, 0}, { _fourhundredval_, 1, 0},
|
||||
{ _twentyfourval_, 1, 0}
|
||||
};
|
||||
|
||||
ZVALUE _zero_ = { _zeroval_, 1, 0};
|
||||
|
Reference in New Issue
Block a user