This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-09-28 21:16:00

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

int of....

([int v] of (9))
What it do?


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#2 2012-09-28 21:26:07

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: int of....

Hmmm… I can't find that block in Scratch 1.4. Where did you find it?


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2012-09-28 22:25:38

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: int of....

ErnieParke wrote:

Hmmm… I can't find that block in Scratch 1.4. Where did you find it?

its in the 2.0 alpha


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#4 2012-09-28 22:38:49

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: int of....

same thing as floor, it truncates/rounds down


Posts: 20000 - Show all posts

Offline

 

#5 2012-09-28 22:48:46

777w
Scratcher
Registered: 2009-02-10
Posts: 1000+

Re: int of....

i think you should save 2.0 questions for when 2.0 actually comes out

Offline

 

#6 2012-09-29 00:23:42

CheeseMunchy
Scratcher
Registered: 2008-10-13
Posts: 1000+

Re: int of....

777w wrote:

i think you should save 2.0 questions for when 2.0 actually comes out


6418,

Offline

 

#7 2012-09-29 00:48:51

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: int of....

CheeseMunchy wrote:

777w wrote:

i think you should save 2.0 questions for when 2.0 actually comes out

why?
wouldn't it be helpful for the scratch team if they were to see this to know what people find confusing and would need documentation?


Posts: 20000 - Show all posts

Offline

 

#8 2012-09-29 04:27:24

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: int of....

veggieman001 wrote:

same thing as floor, it truncates/rounds down

So why do they have both then


Why

Offline

 

#9 2012-09-29 09:37:59

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: int of....

RedRocker227 wrote:

veggieman001 wrote:

same thing as floor, it truncates/rounds down

So why do they have both then

My question exactly.
What does int mean?
In C and C++ and a couple other C languages, int means an integer.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#10 2012-09-29 09:43:21

Molybdenum
Scratcher
Registered: 2012-06-17
Posts: 1000+

Re: int of....

Firedrake969 wrote:

RedRocker227 wrote:

veggieman001 wrote:

same thing as floor, it truncates/rounds down

So why do they have both then

My question exactly.
What does int mean?
In C and C++ and a couple other C languages, int means an integer.

In TI-Basic, it actually means the same as ipart(x), round down. Maybe its just a duplicate they forgot to remove?


"The Enrichment Center is required to remind you that you will be baked, and then there will be cake."
(|Balls and Platforms: Stay on!|) (|NaOS-H: An operating system... Or is it?|)

Offline

 

#11 2012-09-29 10:00:59

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: int of....

Yea, it's a duplicate.  Closing.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#12 2012-09-29 11:54:46

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: int of....

RedRocker227 wrote:

veggieman001 wrote:

same thing as floor, it truncates/rounds down

So why do they have both then

i have no idea

Firedrake969 wrote:

RedRocker227 wrote:

veggieman001 wrote:

same thing as floor, it truncates/rounds down

So why do they have both then

My question exactly.
What does int mean?
In C and C++ and a couple other C languages, int means an integer.

yes, it means integer pretty universally
so what it does is casts a number into an integer via truncation (cutting off all the decimals, or rounding down)

it's equivalent to doing this in java:

int x = (int) 3.45209


Posts: 20000 - Show all posts

Offline

 

#13 2012-09-29 12:08:37

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: int of....

veggieman001 wrote:

RedRocker227 wrote:

veggieman001 wrote:

same thing as floor, it truncates/rounds down

So why do they have both then

i have no idea

Firedrake969 wrote:

RedRocker227 wrote:


So why do they have both then

My question exactly.
What does int mean?
In C and C++ and a couple other C languages, int means an integer.

yes, it means integer pretty universally
so what it does is casts a number into an integer via truncation (cutting off all the decimals, or rounding down)

it's equivalent to doing this in java:

int x = (int) 3.45209

I don't speak Java.
So it's a duplicate block?


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#14 2012-09-29 12:18:58

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: int of....

Firedrake969 wrote:

veggieman001 wrote:

RedRocker227 wrote:


So why do they have both then

i have no idea

Firedrake969 wrote:

My question exactly.
What does int mean?
In C and C++ and a couple other C languages, int means an integer.

yes, it means integer pretty universally
so what it does is casts a number into an integer via truncation (cutting off all the decimals, or rounding down)

it's equivalent to doing this in java:

int x = (int) 3.45209

I don't speak Java.
So it's a duplicate block?

No. Round () rounds to the nearest whole number while this block rounds down. For example, ( int of (6.99) ) is the same as 6.

Last edited by ErnieParke (2012-09-29 14:38:45)


http://i46.tinypic.com/35ismmc.png

Offline

 

#15 2012-09-29 12:19:57

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: int of....

ErnieParke wrote:

Firedrake969 wrote:

veggieman001 wrote:

RedRocker227 wrote:

veggieman001 wrote:

same thing as floor, it truncates/rounds down

So why do they have both then

i have no idea


yes, it means integer pretty universally
so what it does is casts a number into an integer via truncation (cutting off all the decimals, or rounding down)

it's equivalent to doing this in java:

int x = (int) 3.45209

I don't speak Java.
So it's a duplicate block?

No. Round () rounds to the nearest whole number while this block rounds down. For example, ( int of (6.99) ) is the same as 7.

I meant floor.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#16 2012-09-29 12:48:56

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: int of....

Closed by request of the topic owner.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#17 2012-09-29 14:08:26

cheddargirl
Scratch Team
Registered: 2008-09-15
Posts: 1000+

Re: int of....

Reopened by request.


http://i.imgur.com/8QRYx.png
Everything is better when you add a little cheddar, because when you have cheese your life is at ease  smile

Offline

 

#18 2012-09-29 14:11:24

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: int of....

ErnieParke wrote:

Firedrake969 wrote:

veggieman001 wrote:

RedRocker227 wrote:

veggieman001 wrote:

same thing as floor, it truncates/rounds down

So why do they have both then

i have no idea


yes, it means integer pretty universally
so what it does is casts a number into an integer via truncation (cutting off all the decimals, or rounding down)

it's equivalent to doing this in java:

int x = (int) 3.45209

I don't speak Java.
So it's a duplicate block?

No. Round () rounds to the nearest whole number while this block rounds down. For example, ( int of (6.99) ) is the same as 7.

i think you mean int of 6.99 is 6


Posts: 20000 - Show all posts

Offline

 

#19 2012-09-29 14:38:29

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: int of....

veggieman001 wrote:

ErnieParke wrote:

Firedrake969 wrote:


I don't speak Java.
So it's a duplicate block?

No. Round () rounds to the nearest whole number while this block rounds down. For example, ( int of (6.99) ) is the same as 7.

i think you mean int of 6.99 is 6

That was a typo. Thanks for catching it!


http://i46.tinypic.com/35ismmc.png

Offline

 

#20 2012-09-29 19:04:55

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: int of....

I'm actually quite confused about this too.

If it's anything like python, int would turn floats and numerical strings into integers, but floor would only work on floats/integers.

I'm not sure what their purpose is.

Offline

 

#21 2012-09-29 19:24:03

777w
Scratcher
Registered: 2009-02-10
Posts: 1000+

Re: int of....

veggieman001 wrote:

CheeseMunchy wrote:

777w wrote:

i think you should save 2.0 questions for when 2.0 actually comes out

why?
wouldn't it be helpful for the scratch team if they were to see this to know what people find confusing and would need documentation?

oh yes okay that makes sense

Offline

 

Board footer