[Jprogramming] Drop trailing zeros in a number

Andrew Nikitin nsg21 at hotmail.com
Mon Sep 26 22:06:17 HKT 2011


Mike Day mike_liz.day at tiscali.co.uk  wrote:
 
> I had another method involving q: and dividing by 10 ^ the
> lesser of the powers of 2 and 5 in the factors,  but it hangs J in
> some circumstances!
 
Dyadic q: to the rescue:
 
   (% 10 ^ [: <./ 0 2 {3&q:) 12345024500000x
123450245

But, if you ARE using dyadic q: and it still freezes J, then this is probably, a bug. Submit it.
 
  		 	   		  


More information about the Programming mailing list