I suspect that you're code is not being required at all because the code you
pasted isn't going to work and the behavior you're seeing is as if it's not
present. The code should be:

def exp(value, power)
 Sass::Script::Number.new(value.value**power.value)
end

chris

On Sun, Apr 24, 2011 at 11:32 AM, davidyeiser
<da...@designintellection.com>wrote:

> Ah, gotcha. Thanks.
>
> This is what I added to the functions.rb file:
>
> def exp(value, power)
>  Sass::Script::Number.new(value**power)
> end
>
> (I added it beneath the def abs(value) function.)
>
> However, when I use it in my .scss file and then output it to .css it
> doesn't execute.
>
> For example:
>
> style.scss
> ----------
> font-size: exp(2px, 3);
>
> Outputs to:
>
> style.css
> ---------
> font-size: exp(2px, 3);
>
> The other functions execute fine, and the command line output gives no
> error. (I'm using sass --watch style.scss:style.css --style compact)
>
> Any idea on what I'm doing wrong?
>
> P.S. It's probably obvious that I've never programmed in Ruby before,
> and if this mailing list isn't supposed to be used for n00b support
> just let me know. Thanks!
>
> On Apr 24, 10:39 am, Chris Eppstein <ch...@eppsteins.net> wrote:
> > You're not missing it. There's no syntax or function for this. You can
> add a custom function to sass to implement this in ruby.
> >
> > Chris
> >
> > Hunt & pecked on my iPhone... Sorry if it's brief!
> >
> > On Apr 23, 2011, at 10:29 PM, davidyeiser <da...@designintellection.com>
> wrote:
> >
> >
> >
> > > Forgive me if I'm missing something obvious, but is there a default
> > > way for SASS to execute exponential operators?
> >
> > > So, for example: 2 ^ 3 = 8
> >
> > > Thank you!
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups "Haml" group.
> > > To post to this group, send email to haml@googlegroups.com.
> > > To unsubscribe from this group, send email to
> haml+unsubscr...@googlegroups.com.
> > > For more options, visit this group athttp://
> groups.google.com/group/haml?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Haml" group.
> To post to this group, send email to haml@googlegroups.com.
> To unsubscribe from this group, send email to
> haml+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/haml?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to haml@googlegroups.com.
To unsubscribe from this group, send email to haml+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to