say I have this code:
a = 4//2
This returns me "2//1"
b = 4//3
This returns me "4//3"
I understand that it is returning the value of a and b in simplest form. But what then? I thought that this operator returns the value of division in integer form, taking away the reminder. But it does not seem this is what it is doing.
I actually have this code:
x=Fun(identity,0..4π)
d=domain(x)
B=[ldirichlet(d),lneumann(d),rneumann(d)]
D=Derivative(d)
κ = 0.33205733621519630
u0 = (1//2) * κ * x^2
I wanted to know what (1//2) here is. From what I had thought earlier, this should have been equal to zero, but that is not what is required here. Can please someone clarify what is happening here and how does the // operator works?
2//3is a rational number, I suppose you might call the//operator a constructor. - High Performance Mark5//10, which will yield1//2as the result. It reduces the ratio by eliminating common divisors of the numerator and denominator. - pjs//in Python and Julia is quite different. - phipsgabler