Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

compile fct. using Goto and If (vrs. 8)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128047] compile fct. using Goto and If (vrs. 8)
  • From: Chris <kristoph.steikert at gmail.com>
  • Date: Tue, 11 Sep 2012 02:33:49 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

Hi 

Below I post some rudimentary and insubstantial code. My basic question is why the command Goto does not work properly when used in an if statement in a compile function. Does anybody know a way around this problem? 

Thanks in advance.
Chris


toy=Compile[{{x,_Real}},
	Label[t];
	y=RandomReal[{-1.,1.}];
	If[x*y<-0.,Print[y*x];Goto[t],Print[y*x," ","done"]]
];



  • Prev by Date: Re: Begginer's question: Saving a function for later use
  • Next by Date: Re: Landau letter, Re: Mathematica as a New Approach...
  • Previous by thread: Re: Begginer's question: Saving a function for later use
  • Next by thread: Re: compile fct. using Goto and If (vrs. 8)