0 4:04 PM
> To: CF-Talk
> Subject: RE: Power of 3
>
> Nathan,
>
> I think you're a little off in your interpretation.
>
> 3 ^ 3 = 27 ( 3 x 3 = 9, 9 x 3 = 27)
>
> 27 ^ (1/3) = 3
>
> - Dan
>
> -Original Message-
> From: Nathan Sta
> Yahh.. :-)
Drat. Courtney wins again.
> Courtney E. Payne, Developer
> Fig Leaf Software
> "We've got you covered"
> [EMAIL PROTECTED]
> www.figleaf.com
Archives: http://www.mail-archi
Let's ask Damon for an IsPowerOfThree function in SP3.
-David
On Fri, 27 Oct 2000 12:36:25 -0400 "Jon Hall" <[EMAIL PROTECTED]>
writes:
> Anyone have an idea on how to check to see if a value is a power of
> 3?
YOU'RE PAYING TOO MU
Nathan,
I think you're a little off in your interpretation.
3 ^ 3 = 27 ( 3 x 3 = 9, 9 x 3 = 27)
27 ^ (1/3) = 3
- Dan
-Original Message-
From: Nathan Stanford [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 27, 2000 4:17 PM
To: CF-Talk
Subject: RE: Power of 3
Accordi
] www.cftipsplus.com
__
> -Original Message-
> From: Bob Silverberg [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, October 27, 2000 2:30 PM
> To: CF-Talk
> Subject: RE: Power of 3
>
> I don't believe that a cubed root would s
> I don't believe that a cubed root would solve his problem, but
> it's easy to
> do one in CF. Just remember (from your high school math days) that the
> cubed root of a number is the same as that number raised to 1/3.
You're right. On both counts. It would have to be an nth root, so easier
ju
hat simple,
Bob
-Original Message-
From: lsellers [mailto:[EMAIL PROTECTED]]
Sent: October 27, 2000 2:20 PM
To: CF-Talk
Subject: RE: Power of 3
> > Anyone have an idea on how to check to see if a value is a power of 3?
>
> Umm. Take it's cubed root? See if the fraction is
then the World!
>
>jon
>- Original Message -
>From: <[EMAIL PROTECTED]>
>To: "CF-Talk" <[EMAIL PROTECTED]>
>Sent: Friday, October 27, 2000 1:06 PM
>Subject: RE: Power of 3
>
>
>> It's not very elegant, but the most efficient me
Here it goes (I started with David Gassner's code and here is what I
have.)
__
Nathan Stanford ColdFusion Tips Plus
[EMAIL PROTECTED] www.cftipsplus.com
__
Since everyone else has taken a stab at it, this is how I would do it:
There aren't that many powers of three, so I think it would be quicker to pick
it out of a list.
tom
- Original Message -
From: "Jon Hall" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Friday, Octobe
Yahh.. :-)
Courtney E. Payne, Developer
Fig Leaf Software
"We've got you covered"
[EMAIL PROTECTED]
www.figleaf.com
-Original Message-
From: Nathan Stanford [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 27, 2000 2:10 PM
To: CF-Talk
Subject: RE: Power of
> > Anyone have an idea on how to check to see if a value is a power of 3?
>
> Umm. Take it's cubed root? See if the fraction is other than 0?
> --min
Notcing a few posts go by today, I thought I'd expand by saying that _IF_
you know the upper limit to these number then the best thing to do is a
Okay, Okay, Quick Question can you give us a hint as to why you want this?
__
Nathan Stanford ColdFusion Tips Plus
[EMAIL PROTECTED] www.cftipsplus.com
__
I guess you could run a loop and keep dividing by 3 until the final number
is either 1 or has a decimal
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoff
Sent: Friday, October 27, 2000 1:06 PM
Subject: RE: Power of 3
> It's not very elegant, but the most efficient method (assuming it's always
3
> that you care about) might be to put all the values you care about into a
> list in the application or request scope and do a list
in that case, I'd have to go with Courtney on this one. you could do a "3
EXP counter" comparison, too (using her logic structure).
~Simon
-Original Message-
From: Steve Martin [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 27, 2000 1:06 PM
To: CF-Talk
Subject: RE: Pow
alk
Subject: RE: Power of 3
6 mod 3 is 0 as well Simon.
> -Original Message-
> From: Simon Horwith [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 27, 2000 17:47
> To: CF-Talk
> Subject: RE: Power of 3
>
>
>
>
> ~Simon
>
> -Original Mes
of times a number is
divisible by 3 also happens to be divisible by 3, though.
~Simon
-Original Message-
From: Gavin Myers [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 27, 2000 1:11 PM
To: CF-Talk
Subject: RE: Power of 3
would this work:
The random number is:
#x#
Here's another entry:
#isPower#
> -Original Message-
> From: Jon Hall [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 27, 2000 9:36 AM
> To: CF-Talk
> Subject: Power of 3
>
>
> Anyone have an idea on how to check to see if a value is a power of 3?
>
>
6 mod 3 is 0 as well Simon.
> -Original Message-
> From: Simon Horwith [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 27, 2000 17:47
> To: CF-Talk
> Subject: RE: Power of 3
>
>
>
>
> ~Simon
>
> -Original Message-
> From: Jon Hall [m
]]
Sent: Friday, October 27, 2000 11:47 AM
To: CF-Talk
Subject: RE: Power of 3
~Simon
-Original Message-
From: Jon Hall [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 27, 2000 12:36 PM
To: CF-Talk
Subject: Power of 3
Anyone have an idea on how to check to see if a value is a power
It's not very elegant, but the most efficient method (assuming it's always 3
that you care about) might be to put all the values you care about into a
list in the application or request scope and do a listfind. You can't have
that many entries before you hit the CF biggest-number limit.
-Ori
... your code to be executed only on every 3rd power ...
Courtney E. Payne, Developer
Fig Leaf Software
"We've got you covered"
[EMAIL PROTECTED]
www.figleaf.com
-Original Message-
From: Jon Hall [mailto:[EMAIL PROTECTED]]
Sent: Fri
>
> Anyone have an idea on how to check to see if a value is a power of 3?
Umm. Take it's cubed root? See if the fraction is other than 0?
--min
Archives: http://www.mail-archive.com/cf-talk@houseo
~Simon
-Original Message-
From: Jon Hall [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 27, 2000 12:36 PM
To: CF-Talk
Subject: Power of 3
Anyone have an idea on how to check to see if a value is a power of 3?
I have a loop that needs to fire an event at every power of three that it
25 matches
Mail list logo