Don't forget,
| > str/-5; | (1) Result: ({ /* 3 elements */ | "45123", | "45123", | "45123" | }) | > str/-5.0; | (2) Result: ({ /* 4 elements */ | "123", | "45123", | "45123", | "45123" | })
:)
/ Mirar
Previous text:
2003-01-02 22:27: Subject: Re: PLEAC
In the last episode (Jan 02), Martin Baehr said:
On Thu, Jan 02, 2003 at 10:15:01PM +0100, Peter Lundqvist (disjunkt) @ Pike (-) developers forum wrote:
<curios> I have no pike handy at the moment. What is the difference between using a float and an integer? </curios>
string str="123451234512345123";
Result: "123451234512345123"
array fivers = str/5.0;
Result: ({ /* 4 elements */ "12345", "12345", "12345", "123" })
What's even more fun is
str/4.5;
(1) Result: ({ /* 4 elements */ "12345", "1234", "51234", "5123" })
I don't know how useful that is, but it does exactly what I expect dividing by a non-int value would do.
-- Dan Nelson dnelson@allantgroup.com
/ Brevbäraren