From: Matthew B. <mat...@gm...> - 2006-09-25 14:35:23
|
Hi, I am sorry if I have missed anything obvious here, but is there a fast simple way to downcast an array to the smallest storage that hold array data within a specified precision - e.g. a = array([1.0]) small_a = fantasy_function(a, rtol=1.0000000000000001e-05, atol=1e-08 ) b = array([1.2]) small_b = fantasy_function(b, tol=1.0000000000000001e-05, atol=1e-08) where a.dtype becomes, say, uint8, and b.dtype becomes float32? Thanks a lot, Matthew |