The new dfc and dfc2f functions in action
|
07-10-2018, 06:47 AM
Post: #7
|
|||
|
|||
RE: The new dfc and dfc2f functions in action
(01-10-2018 02:07 PM)DrD Wrote: I tried this: Some firmware versions don't allow CAS programs to pre-set variables' values, so I suggest replacing the first line with just Code: edfc(nbr1,nbr2):= Suggestion: Replace these two lines: Code: M0:=dfc(nbr1); Code: M0:=append(dfc(exact(nbr1)),MAXREAL); This solves two problems: (1) It prevents early-terminating continued fractions from erroring out, e.g. edfc(0.4, 0.5). (2) It gets the intended result for decimal inputs, e.g. edfc(0.4, 0.41), which should return 9/22, but otherwise returns 2/5, because 0.4 in CAS is really slightly less than 0.4 due to CAS' use of binary floats. Thanks for a great program, Dale! <0|ΙΈ|0> -Joe- |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
The new dfc and dfc2f functions in action - Joe Horn - 01-10-2018, 01:37 AM
RE: The new dfc and dfc2f functions in action - salvomic - 01-10-2018, 07:47 AM
RE: The new dfc and dfc2f functions in action - Joe Horn - 01-11-2018, 02:33 AM
RE: The new dfc and dfc2f functions in action - salvomic - 01-11-2018, 07:23 AM
RE: The new dfc and dfc2f functions in action - DrD - 01-10-2018, 02:07 PM
RE: The new dfc and dfc2f functions in action - Joe Horn - 07-10-2018 06:47 AM
RE: The new dfc and dfc2f functions in action - Didier Lachieze - 07-10-2018, 08:30 AM
RE: The new dfc and dfc2f functions in action - Joe Horn - 07-10-2018, 05:09 PM
RE: The new dfc and dfc2f functions in action - webmasterpdx - 01-11-2018, 05:55 AM
RE: The new dfc and dfc2f functions in action - Joe Horn - 07-10-2018, 06:42 PM
RE: The new dfc and dfc2f functions in action - Joe Horn - 07-30-2018, 04:44 PM
|
User(s) browsing this thread: 1 Guest(s)