Talk:Check Machin-like formulas

From Rosetta Code

Aesthetics

The original equations without the math formatting have a lot going for them. What do you think? --Paddy3118 21:08, 8 November 2012 (UTC)

The text format can be used for data input (as in the Python example) and the formatted fractions are a bit crowded (small line spacing).
There are some odd text sizes now, the last identity [tan(-a)=-tan(a)] is in a smaller fontwith Firefox 16.0.2, anyone else see this?
If we can't improve the current layout I would prefer the original format. TobyK 22:22, 8 November 2012 (UTC)
That's why I was careful to not use the fully stacked form; it forces the mediawiki <math> environment to switch from inline mode (converting to appropriate HTML) to display mode (pushing through LaTeX to make an image). With inline mode, it would have been reasonable to expect a cut-n-paste-into-parser approach to work; display mode makes that impossible (well, not without OCRing things first, which is another few orders of magnitude of complexity!) –Donal Fellows 11:42, 9 November 2012 (UTC)
Well, not really. Whether math shows as image or text (or MathML) depends on user wiki pref settings. The only way to garantee copy/paste is keep it in text format, and if you want to use math environment, might as well let wiki engine format it nicer since you won't know if it comes out as an image (or MathML) anyway. --Ledrug 18:22, 9 November 2012 (UTC)

OCaml: Very long line

Could the OCaml be changed to indicate equality with one as a short true/false indicator rather than printing out the very long line? Thanks. --Paddy3118 21:24, 8 November 2012 (UTC)

OK, I have changed the Ocaml program so the output is shorter TobyK 22:07, 8 November 2012 (UTC)
(... And thanks for the task Toby. I enjoyed it :-)
--Paddy3118 06:05, 9 November 2012 (UTC)

Non-draft task

I've changed this to a non-draft task since there are now several different language solutions and there seem to be no problems with the problem definition. Comment if you think there are any outstanding issues. TobyK 19:02, 9 December 2012 (UTC)

Floating-point calculations

I don't believe the J or Perl 6 entries are using exact arithmetic, unless they are using non-obvious symbolic language features. I will flag these as incorrect unless someone can explain how they are exact. TobyK 13:16, 20 December 2012 (UTC)

In J, exact arithmetic is termed "extended precision" (or when specifically describing non-integral values, we sometimes say "rational"). And, as noted in the J solution "the function x: coerces values to extended precision; thereafter J will maintain extended precision throughout its calculations, as long as it can.".
For example, dividing one by seven with 1%7 by default produces the float point approximation 0.142857, but coercing extended precision with x: 1%7 produces the exact ratio 1r7 (which is J's notation for rational numbers). J will carry exact values as far as it can through its computations; there are some built-in functions which have not been designed to produce exact results, and will revert to floating point values. Users have no control over these functions, and if they want a work-alike that produces exact results, they must write it themselves.
--DanBron 20:04, 20 December 2012 (UTC)