Discuss Scratch

45afc4td
Scratcher
100+ posts

64-bit integers

uint64_t [test v] = (-1) :: variables
return (test) :: looks
18446744073709551615

uint64_t [test v] = (13) :: variables
[test v] = ((test) ^ ((test) \<\< (1) :: operators) :: operators) :: variables stack
return (test) :: looks
23

I demand 64-bit integers. With it standard operations like bitshift “<<”, “>>”, xor “^”, or “|”, etc.
45afc4td
Scratcher
100+ posts

64-bit integers

64-bit integer arrays

uint64_t[4] [test2] ::list

This is one of the most natural ways to store 256 bits.

RNG initialization

uint64_t [x] = [Enter a 64-bit seed here! 0x0000000000000000 to 0xFFFFFFFFFFFFFFFF! Scratch's built-in RNG could work for this]::variables
uint64_t [z] = ([x v] += [0x9e3779b97f4a7c15]::variables stack)::variables
[z v] = (([z v] ^ ([z v] >> [30]::operators)::operators) * [0xbf58476d1ce4e5b9])::variables stack
[z v] = (([z v] ^ ([z v] >> [27]::operators)::operators) * [0x94d049bb133111eb])::variables stack
[test2 v][0] = ([z v] ^ ([z v] >> [31]::operators)::operators)::list
[z v] = ([x v] += [0x9e3779b97f4a7c15]::variables stack)::variables stack
[z v] = (([z v] ^ ([z v] >> [30]::operators)::operators) * [0xbf58476d1ce4e5b9])::variables stack
[z v] = (([z v] ^ ([z v] >> [27]::operators)::operators) * [0x94d049bb133111eb])::variables stack
[test2 v][1] = ([z v] ^ ([z v] >> [31]::operators)::operators)::list
[z v] = ([x v] += [0x9e3779b97f4a7c15]::variables stack)::variables stack
[z v] = (([z v] ^ ([z v] >> [30]::operators)::operators) * [0xbf58476d1ce4e5b9])::variables stack
[z v] = (([z v] ^ ([z v] >> [27]::operators)::operators) * [0x94d049bb133111eb])::variables stack
[test2 v][2] = ([z v] ^ ([z v] >> [31]::operators)::operators)::list
[z v] = ([x v] += [0x9e3779b97f4a7c15]::variables stack)::variables stack
[z v] = (([z v] ^ ([z v] >> [30]::operators)::operators) * [0xbf58476d1ce4e5b9])::variables stack
[z v] = (([z v] ^ ([z v] >> [27]::operators)::operators) * [0x94d049bb133111eb])::variables stack
[test2 v][3] = ([z v] ^ ([z v] >> [31]::operators)::operators)::list

Random number generator (used indefinitely, after the initial initialization)

uint64_t [result] = (([test2 v][1]::list)*[5])::variables
[result v] = (((([result v]::variables)\<\<[7]::operators)|(([result v]::variables)\>\>[57]::operators)::operators)*[9])::variables stack
uint64_t [temp] = (([test2 v][1]::list)\<\<[17]::operators)::variables
[test2 v][2] ^= ([test2 v][0]::list)::list
[test2 v][3] ^= ([test2 v][1]::list)::list
[test2 v][1] ^= ([test2 v][2]::list)::list
[test2 v][0] ^= ([test2 v][3]::list)::list
[test2 v][2] ^= ([temp v]::variables)::list
[test2 v][3] = ((([test2 v][3]::list)\<\<[45]::operators)|(([test2 v][3]::list)\>\>[19]::operators)::operators)::list
45afc4td
Scratcher
100+ posts

64-bit integers

I select this particular time for the bump.
AFNNetworkK12
Scratcher
1000+ posts

64-bit integers

No support. Scratch is supposed to be simple, that would be confusing to younger people.

AFN!


| Okay | Hobbyist | Introvert | Active | OK! |


HELLO
45afc4td
Scratcher
100+ posts

64-bit integers

AFNNetworkK12 wrote:

No support. Scratch is supposed to be simple, that would be confusing to younger people.
Isn't floating point with its significant place rounding even more confusing than unsigned integers with overflow?
Nambaseking01
Scratcher
1000+ posts

64-bit integers

45afc4td wrote:

-snip-
Isn't floating point with its significant place rounding even more confusing than unsigned integers with overflow?

I am ten years old, have been on Scratch for over a year and don't understand a single bit of what this means. I've come to the conclusion that this is extremely difficult for young kids.

Perhaps it could be an extension?

Hey there! My name is Nammy. I'm a male Forum Helper and Scratch Wiki Editor.
Profile | Test Account | Talk with me here! | Griffpatch is quitting Scratch?!
WindOctahedron
Scratcher
1000+ posts

64-bit integers

Nambaseking01 wrote:

45afc4td wrote:

-snip-
Isn't floating point with its significant place rounding even more confusing than unsigned integers with overflow?

I am ten years old, have been on Scratch for over a year and don't understand a single bit of what this means.
Okay, I used the internet to look those up, and that's how I interpret it (I might be completely wrong):
Isn't notating numbers as a whole number × a power of 10 with rounding to the first non-zero digit more confusing than values that can't be represented as negative with a situation in which too many bits are required to represent a number?

Last edited by WindOctahedron (Nov. 26, 2019 20:40:15)


The message above may contain wrong information, rude remarks, or something embarrassing to my current self. In this case, please ignore it and remember that I likely wrote it back when I didn't know what “respect” truly meant. I really hate thinking about it again.
Flowermanvista
Scratcher
1000+ posts

64-bit integers

I'm just going to say this again: JavaScript only has one natively supported number type, which is a double float. If you make a number in JavaScript, it is a double float - no ifs, ands, or buts.

Add a SPOOKY SKELETON to your project!

The Scratch 3 Project Save Troubleshooter - find out why your project won't save

ST, Please Add A Warning When A Size Limit Is Exceeded

My Dumb Creations - THE BEST ANIMATION | The Windows 98 Experience (made on Windows 98) | nobody cares about Me… | the2000 Reveals His New Profile Picture | Not Dumb Creations - Ten Years
Ctrl+Shift+Down for more…
Do evil kumquats keep eating your signature? Assert your dominance and eat the evil kumquats. Did you know that kumquats are only about the size of an olive?
45afc4td
Scratcher
100+ posts

64-bit integers

WindOctahedron wrote:

Nambaseking01 wrote:

45afc4td wrote:

-snip-
Isn't floating point with its significant place rounding even more confusing than unsigned integers with overflow?

I am ten years old, have been on Scratch for over a year and don't understand a single bit of what this means.
Okay, I used the internet to look those up, and that's how I interpret it (I might be completely wrong):
Isn't notating numbers as a whole number × a power of 10 with rounding to the first non-zero digit more confusing than values that can't be represented as negative with a situation in which too many bits are required to represent a number?
First of all, double float isn't stored in decimal. So all rounding to 53 significant places is in binary. 0.1+0.2=0.30000000000000004 in a double because it's how it rounds to 53 significant places in binary, and that in turn does not equal 0.3. When it exceeds an exponent limit, it clamps to Infinity or -Infinity.

Meanwhile, integers have overflow. It means it's like a standard integer number line, except that it's an infinite loop. For signed 16-bit integers after 32767 comes -32768, and for unsigned 64-bit integers after 18446744073709551615 comes 0. Addition, subtraction and multiplication don't have rounding errors, they overflow. Division proceeds with a standard rounding down… to integer. Bitshift, or, xor, and, not — those are bitwise operations to manipulate integer bits.
Nambaseking01
Scratcher
1000+ posts

64-bit integers

WindOctahedron wrote:

-snip-
Okay, I used the internet to look those up, and that's how I interpret it (I might be completely wrong):
Isn't notating numbers as a whole number × a power of 10 with rounding to the first non-zero digit more confusing than values that can't be represented as negative with a situation in which too many bits are required to represent a number?

But still, this should probably be an extension if it existed - it's way too complicated to understand.

Hey there! My name is Nammy. I'm a male Forum Helper and Scratch Wiki Editor.
Profile | Test Account | Talk with me here! | Griffpatch is quitting Scratch?!
Flowermanvista
Scratcher
1000+ posts

64-bit integers

Flowermanvista wrote:

I'm just going to say this again: JavaScript only has one natively supported number type, which is a double float. If you make a number in JavaScript, it is a double float - no ifs, ands, or buts.

Add a SPOOKY SKELETON to your project!

The Scratch 3 Project Save Troubleshooter - find out why your project won't save

ST, Please Add A Warning When A Size Limit Is Exceeded

My Dumb Creations - THE BEST ANIMATION | The Windows 98 Experience (made on Windows 98) | nobody cares about Me… | the2000 Reveals His New Profile Picture | Not Dumb Creations - Ten Years
Ctrl+Shift+Down for more…
Do evil kumquats keep eating your signature? Assert your dominance and eat the evil kumquats. Did you know that kumquats are only about the size of an olive?
45afc4td
Scratcher
100+ posts

64-bit integers

Flowermanvista wrote:

Flowermanvista wrote:

I'm just going to say this again: JavaScript only has one natively supported number type, which is a double float. If you make a number in JavaScript, it is a double float - no ifs, ands, or buts.
Scratch 3.0 is made in WebGL. HTML5 isn't all about JavaScript.
45afc4td
Scratcher
100+ posts

64-bit integers

Nambaseking01 wrote:

WindOctahedron wrote:

-snip-
Okay, I used the internet to look those up, and that's how I interpret it (I might be completely wrong):
Isn't notating numbers as a whole number × a power of 10 with rounding to the first non-zero digit more confusing than values that can't be represented as negative with a situation in which too many bits are required to represent a number?

But still, this should probably be an extension if it existed - it's way too complicated to understand.
This is NOT complicated to understand with binary knowledge.
qucchia
Scratcher
100+ posts

64-bit integers

These blocks seem like they would only be used in very specific cases, and so wouldn't be a very useful addition.
I think the best thing you can do is make some custom blocks that do the operations.
xDcorruptZ
Scratcher
48 posts

64-bit integers

qucchia wrote:

These blocks seem like they would only be used in very specific cases, and so wouldn't be a very useful addition.
I think the best thing you can do is make some custom blocks that do the operations.
it would be used more than
(days since 2000)

Last edited by xDcorruptZ (Nov. 29, 2019 19:01:15)

45afc4td
Scratcher
100+ posts

64-bit integers

qucchia wrote:

These blocks seem like they would only be used in very specific cases, and so wouldn't be a very useful addition.
I think the best thing you can do is make some custom blocks that do the operations.
Custom blocks don't return values, they only themselves perform actions so they will further bloat the code.
Flowermanvista
Scratcher
1000+ posts

64-bit integers

45afc4td wrote:

Flowermanvista wrote:

Flowermanvista wrote:

I'm just going to say this again: JavaScript only has one natively supported number type, which is a double float. If you make a number in JavaScript, it is a double float - no ifs, ands, or buts.
Scratch 3.0 is made in WebGL. HTML5 isn't all about JavaScript.
WebGL is a graphics API for JavaScript, not a general purpose programming language.

Add a SPOOKY SKELETON to your project!

The Scratch 3 Project Save Troubleshooter - find out why your project won't save

ST, Please Add A Warning When A Size Limit Is Exceeded

My Dumb Creations - THE BEST ANIMATION | The Windows 98 Experience (made on Windows 98) | nobody cares about Me… | the2000 Reveals His New Profile Picture | Not Dumb Creations - Ten Years
Ctrl+Shift+Down for more…
Do evil kumquats keep eating your signature? Assert your dominance and eat the evil kumquats. Did you know that kumquats are only about the size of an olive?
45afc4td
Scratcher
100+ posts

64-bit integers

There only being a double float is by far what I dislike the most about Scratch. It's incredibly boring to keep using double floats. So having, aside from 64-bit float variables, also 64-bit integers will make Scratch more interesting and deep.
LastContinue
Scratcher
500+ posts

64-bit integers

45afc4td wrote:

There only being a double float is by far what I dislike the most about Scratch. It's incredibly boring to keep using double floats. So having, aside from 64-bit float variables, also 64-bit integers will make Scratch more interesting and deep.

Refer to this (thanks @flowermanvista)

Flowermanvista wrote:

I'm just going to say this again: JavaScript only has one natively supported number type, which is a double float. If you make a number in JavaScript, it is a double float - no ifs, ands, or buts.

Re:

45afc4td wrote:

Flowermanvista wrote:

Flowermanvista wrote:

I'm just going to say this again: JavaScript only has one natively supported number type, which is a double float. If you make a number in JavaScript, it is a double float - no ifs, ands, or buts.
Scratch 3.0 is made in WebGL. HTML5 isn't all about JavaScript.

Ok you've made 3 mistakes in one, but that's no issue. I'll clear things up to help you understand.
When we say Scratch 3.0 is made in HTML5, that's not entirely true, because it isn't a programming language. It's a markup language used to express the document (content and metadata within a page)

The key part that makes Scratch 3.0 tick is it's Javascript. Javascript is the only* way for code to be ran on websites, so yes, when talking about webapps, HTML is all about Javascript*

WebGL is a very modern Graphics API built on top of OpenGL ES[dont quote me on this] that runs within JavaScript (very simplified explanation)

* -> There is also WASM but not much is done with that for DOM content such as Scratch
45afc4td
Scratcher
100+ posts

64-bit integers

Bump'

Powered by DjangoBB