http://en.wikipedia.org/wiki/Hyper_operator integralElem :: (Integral b) => [a] -> b -> a
hyper' :: (Integral a) => a -> (a -> a -> a)
hyper :: (Integral a) => a -> a -> a -> a
integralElem a b = a !! fromIntegral b
hyper' 0 = (+) . flip (^) 0
hyper' 1 = (+)
hyper' 2 = (*)
hyper' 3 = (^)
hyper' 4 = integralElem . (hyper4list)
where hyper4list a = 1 : (zipWith (^) [a,a..] (hyper4list a))
hyper' n = integralElem . (hyperlist n)
where hyperlist n a = 1 : (zipWith (hyper' (n-1)) [a,a..] (hyperlist n a))
hyper a n b = (hyper' n) a b
improvements to the above are welcome.
Name:
Anonymous2009-02-06 18:28
I need help converting from a double to an int or at least i need the values in amount paid to customer to be in the form xx.xx instead of xx.xxxxxxxxxxxxx(etc.)
/*
* CurrencyDollarConverter.java
* Author: MEMEMEMEMEMEMEMEME
* Last edited: 02/06/2009
*
* Purpose: CurrencyDollarConverter.java will display
* the details of a customer’s currency exchange transaction,
* as well as the amount of US Dollars and exact change paid
* to the customer after the currency exchange transaction has been made.
*
* Statement of Academic Honesty:
*
* The following code represents my own work. I have neither
* received nor given inappropriate assistance. I have not copied
* or modified code from any source other than the course webpage
* or the course textbook. I recognize that any unauthorized
* assistance or plagiarism will be handled in accordance with
* the University of Georgia's Academic Honesty Policy and the
* policies of this course.
*/
/* I would prefer calling the variable EXCHANGE_RATE as the 1.2% is a fixed rate
* but the .pdf file says to label it as EXCHANGE_FEE. This would also prevent
* confusion between the EXCHANGE_FEE and the later variable exchangeFee
*/
public static final double EXCHANGE_FEE = 0.012;
public static void main(String[] args) {