Mathematica 9 is now available
Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

question on changing 'type' of numbers

  • To: mathgroup at
  • Subject: [mg69473] question on changing 'type' of numbers
  • From: "Nasser Abbasi" <nma at>
  • Date: Wed, 13 Sep 2006 04:03:10 -0400 (EDT)
  • Reply-to: "Nasser Abbasi" <nma at>

I think of a the Head of expression as its 'type'.

One is supposed to be able to use Apply[f,expr] to change head of expression 
to f.

But Why can't I use this to change the head of a Real number to Integer?

x = 0.1
        ------------------->Real. I was expecting Intger
x = Integer[x]
      ----------------> Now it says Integer

any idea?

ofcourse the question as to what should happen to the value of the variable 
if for example I change the head of 0.5 from Real to Integer is another 
matter. It seems in this case x remained 0.1 but only the head said Integer


Now sure what the above really means :)


  • Prev by Date: Re: tab-delimited file to graph
  • Next by Date: Re: tab-delimited file to graph
  • Previous by thread: Re: Derivative of a function with multiple variables
  • Next by thread: Re: question on changing 'type' of numbers