Am 01.06.2012 08:45, schrieb Bharath M R:
Hi, I was trying to implement interval arithmetic using numpy for plotting. I could not possibly find a way to **round up** a floating point value.
Use math.ceil. I.e. multiply with the scale factor, math.ceil, then divide again. > ie sin(<1, 1>) =<0.841, 0.842>
rounded to 3 decimals.
On a tangent, for code that uses machine floats/doubles, do not round to decimals, round to binary digits. Otherwise, your interval bounds will be inaccurate due to rounding issues between decimal and binary, making it useless to control algorithmic inaccuracy.
-- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.