Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: How do you get Mathematica to evaluate "Floor" to give a number?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109063] Re: How do you get Mathematica to evaluate "Floor" to give a number?
  • From: David Bailey <dave at removedbailey.co.uk>
  • Date: Mon, 12 Apr 2010 06:53:37 -0400 (EDT)
  • References: <hpplek$m7n$1@smc.vnet.net>

John Ertle Jr. wrote:
> In[1]:= J = 367*y + Floor (7*(y + Floor ((m + 9)/12))/4) + Floor (275*m/9) + 
>   da + 1721013.5
> 
> Out[1]:= 2.44254*10^6 + (2200 Floor)/9 + 7/4 Floor (1966 + (17 Floor)/12)
> 
> How do you get Mathematica to evaluate "Floor" to give a number?
> 
Every Mathematica function - including Floor - uses square brackets to 
denote the argument list. This is because ordinary algebraic notation is 
ambiguous:

f(a+b)

can mean f*a + f*b, or it can refer to the function f. Clearly this 
ambiguity must be resolved for computer algebra, and in Mathematica, the 
above expression would mean f*a+f*b, and to refer to a function f, one 
must write f[a+b].

If you write your expressions that  way, AND provide values for the 
various variables in your expression, you will get a numeric answer.

If I have difficulty with a built in function - such as Floor - my first 
approach is to click on the name of the function, and press F1 to get 
the help for that function. This will give you examples of actual use, 
that you can paste into your notebook and change progressively into 
whatever you require.

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Converting the integral of a sum into a sum of integrals
  • Next by Date: Re: Retrieving orphaned code
  • Previous by thread: Re: How do you get Mathematica to evaluate "Floor" to give a number?
  • Next by thread: Re: List Manipulation: Conditionally changing y value