Using a logical Or in the function definition
- To: mathgroup at smc.vnet.net
- Subject: [mg86687] Using a logical Or in the function definition
- From: "ahallam at iastate.edu" <ahallam at iastate.edu>
- Date: Tue, 18 Mar 2008 04:51:01 -0500 (EST)
I would like to use Or in the function definition as in ab[ Or[r_Integer,r_Rational], Or[s_Integer,s_Rational] ]:=r/s; In other words, I want the function to take integers or ratios of integers as arguments, but not real numbers which are not rational. But if I give the function integer arguments, it does not evaluate. If I try ar[ r_Integer , Or[s_Integer , s_Rational]] := r/s; and give an integer first argument it works and so on.
- Follow-Ups:
- Re: Using a logical Or in the function definition
- From: Adriano Pascoletti <adriano.pascoletti@dimi.uniud.it>
- Re: Using a logical Or in the function definition