[Jprogramming] APL thinking ... redisplay of <tax> function
Rob Hodgkinson
rhodgkin at bigpond.net.au
Tue May 16 20:37:02 HKT 2006
Apologies, this is a resend of the code fragment in my last email, which
appeared to be cut/reproduced incorrectly. Hopefully this displays the tax
function properly:
tax
--T-T---------------------------------------------------------------------┐
│4│:│NB. x is taxYYYY containing tax scales as above (eg Tax2005, Tax2006)│
│ │ │NB. y is list of salaries for which tax is to be calculated │
│ │ │TaxBands =. 0{"1 x │
│ │ │TaxRates =. 1{"1 x │
│ │ │parts =. 0 >. (y <."0 1 }.TaxBands,_)-"1 TaxBands │
│ │ │tax =. parts +/ . * TaxRates │
L-+-+----------------------------------------------------------------------
.../Rob
More information about the Programming
mailing list