Welcome To Darwinbots > Newbie

Need a little help with DB math

(1/3) > >>

Botsareus:
Is there a command  (call it “unpow”) that does the vb equivalent of “a ^ (1/b)”?

For example:


--- Quote ---64
3
unpow
--- End quote ---
puts 4 on top of the stack

Botsareus:
Yep, never mind, the answer is "NO". ( I just realised I have been trough this before)

If we really want to get going with this stuff we might as well add a command (call it “depow”) that does the vb equivalent of “Log(a) / Log(b)"

For example:

--- Quote ---64
4
depow
--- End quote ---

puts 3 on top of the stack

Shasta:
What you could do is use an approximation of log, wouldn't exactly be nice and clean however  

Also for your first one do you really need a single operator for that?

--- Code: ---64 1 3 div pow
--- End code ---
This works just fine.

Numsgil:
Really?  I guess it was a change Eric made.  Back in the day 1 3 div 3 mult would have been 0 from integer rounding errors.

Shasta:

--- Quote from: Numsgil ---Really?  I guess it was a change Eric made.  Back in the day 1 3 div 3 mult would have been 0 from integer rounding errors.
--- End quote ---
Oh... actually no, its returns 1 (which makes sense if there are rounding errors). I was under several assumptions, including that it would work because the math works  sorry

Navigation

[0] Message Index

[#] Next page

Go to full version