On Friday, October 3, 2014 11:23:27 AM UTC-7, Christophe Bal wrote: > > Yes but the set of floats is not even a sub ring of the set of rational > numbers. > Nevertheless, floating point computations are widely used. I suspect that most users do not know what a a sub ring is.
If you wish to incorporate floats into a symbolic computation, you can do so by talking about them as a subset of the rationals. Arbitrary precision floats allow you to approximate arbitrarily closely any rational by a nearby "binary rational". You can then rework most (maybe all) of the (usual) numerical routines by adding a tolerance parameter. e.g. instead of cos(x) for x a float, you have cos(x,err) for x a binary-rational-arbitrary-precision-"float" and err -- a similar quantity that says how large an error is acceptable in the cosine computation. Is there a finitely representable computational structure in sympy that is closed under cosine()? > 2014-10-03 5:43 GMT+02:00 Richard Fateman <[email protected] <javascript:>> > : > >> >> >> On Thursday, October 2, 2014 11:11:14 AM UTC-7, Christophe Bal wrote: >>> >>> And what about the following code ? >>> >>> The user of Sympy must know that types are different and so that the >>> variable are not the same things. A float is not a rational. >>> >> >> A float "type" is a different "type" from some other numbers, but in >> fact every binary float >> represents a particular rational number, of the form integer X >> 2^integer. Just happens that >> 1/3 as a rational number, is not a one of those binary floats. >> >> >> >> >>> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] <javascript:> >> . >> Visit this group at http://groups.google.com/group/sympy. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/sympy/94b35738-f6ff-4e72-b82e-7fabed0bd6f8%40googlegroups.com >> >> <https://groups.google.com/d/msgid/sympy/94b35738-f6ff-4e72-b82e-7fabed0bd6f8%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/0a7941dc-f94b-45dc-9472-5a7732bda89d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
