MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: dot minus operator

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73190] Re: [mg73182] dot minus operator
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Wed, 7 Feb 2007 04:49:58 -0500 (EST)
  • Reply-to: hanlonr at cox.net

minus[a_Integer,b_Integer]:=(a-b)*UnitStep[a-b];

Format[minus[a_,b_]]:=DisplayForm[RowBox[
        {a, OverscriptBox["-","."], b}]];

a~minus~b

3~minus~b

a~minus~3

5~minus~3

2

3~minus~5

0


Bob Hanlon

---- "Brambilla Roberto Luigi (CESIRICERCA)" <Roberto.Brambilla at cesiricerca.it> wrote: 
> Hi All,
> 
> How can I define in the the infix style the (integer) operation
> 
> minus[a_,b_]:=If[a>b,a-b,0]
> 
> In std texts it is usually noted by a minus with a dot over it.
> It would be fine to use the same notation.
> 
> Thanks in advance Roberto
> 


  • Prev by Date: Re: String to number
  • Next by Date: Re: String to number
  • Previous by thread: dot minus operator
  • Next by thread: problem with fonts in linux