In short form then:
Put 23 into tX; Put 8 into tY;
Put tX & “/“ & tY && “=“ && (tX div tY) && (tX mod tY) & “/“ & tY into
tCalcString
Sean Cole
Pi Digital Prod Ltd
> On 25 Jun 2019, at 09:09, Mark Waddingham via use-livecode
> wrote:
>
> Q := X div Y
> R := X mod Y
>
> Then you have that
On 2019-06-24 21:26, Richmond via use-livecode wrote:
But it is not much cop when it comes to finding
the quotient of some long and complicated bit of Mathematics.
Perhaps not, but it is what you asked for...
28 div 3 = 9
28 mod 1 = 1
28 / 3 = 9 + 1/3
301 div 10 = 30
301 mod 10 = 1
A (theoretical) circle is effectively a regular polygon with "many" vertices.
LC Script draws only integer valued points (although you can give decimals).
That approximation of a circle by regular polygons is shown in the sample stack
http://forums.livecode.com/viewtopic.php?p=98716#p98716
The s
Some thoughts:
A. Define round as a way to get rid of the fractional part.
B. Use a simple (almost regular) polygon that can be multiplied to be bigger.
C. Create your own functions that hide decimal fractions and let students use
them.
1. Use turtle graphics
D. Draw a circle of diameter 10
I have had no trouble with LiveCode in this respect: that is NOT the
problem: the problem
is that, in Bulgaria, kids have not been taught about numbers with
decimal points when they
are 11 years old (strikes me as a bit late in the day), so am trying to
avoid those just now.
Richmond.
On 24.0
I generally use "round" when working with pixels. But you don't have to,
the LC engine seems to manage decimal pixels for you.
Clever, that engine.
On 6/24/19 2:34 PM, Richmond via use-livecode wrote:
Thanks: I have.
BUT, imagine, if you will, a situation where I want to animate a blob as
in
Ha, ha, ha; they are coming to take me away as I am replying to my own
post yet again.
And this does seem a bit bonkers;
onmouseUp
put0 intoKKK
put1 intoJJJ
repeatuntil KKK > 6.3
put((150 + (100 * (COS(KKK div 1) intoCKKK
put((150 + (100 * (SIN(KKK div 1)
Thanks: I have.
BUT, imagine, if you will, a situation where I want to animate a blob as in:
put 1 into LYNE
repeat until line LYNE of fld "PointsList" is empty
move grc "blob" to line LYNE of fld "PointsList"
wait 2 ticks
add 1 to LYNE
end repeat
Let's suppose those points shoul
Well . . . Um . . . div
But that is alright as far as sums such as 28 div 3 go . . .
But it is not much cop when it comes to finding
the quotient of some long and complicated bit of Mathematics.
On 24.06.19 22:22, Richmond wrote:
Err . . .
So; I have several numbers that have to be divided by
Try ‘div’ :)
Mark.
Sent from my iPhone
> On 24 Jun 2019, at 20:22, Richmond via use-livecode
> wrote:
>
> Err . . .
>
> So; I have several numbers that have to be divided by other numbers:
>
> 28 / 3
>
> 301 / 10
>
> 44 / 6
>
> now these will all yield "awkward numbers" consisting of a q
Thanks Phil and Devin. I had no idea that div and the "/" operator yielded
different results.
On Tue, Jun 23, 2015 at 2:18 PM Devin Asay wrote:
>
> On Jun 23, 2015, at 2:43 PM, Peter Haworth wrote:
>
> > Does LC include an operator to return the quotient of a division
> > operation? For examp
On Jun 23, 2015, at 2:43 PM, Peter Haworth wrote:
> Does LC include an operator to return the quotient of a division
> operation? For example, I want to get 2 as the result of 12 divided by 5.
Are you talking about the div operator?
put 12 div 5 --> 2
And the mod operator gives the remaind
put 12 div 5 into tQuotient
put 12 mod 5 into tRemainder
put 12 / 5 into tDecimalQuotient
Phil
On 6/23/15 1:43 PM, Peter Haworth wrote:
Does LC include an operator to return the quotient of a division
operation? For example, I want to get 2 as the result of 12 divided by 5.
__
13 matches
Mail list logo