Discuss Scratch
- 45afc4td
-
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
-
100+ posts
64-bit integers
64-bit integer arrays
This is one of the most natural ways to store 256 bits.
RNG initialization
Random number generator (used indefinitely, after the initial initialization)
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
- AFNNetworkK12
-
1000+ posts
64-bit integers
No support. Scratch is supposed to be simple, that would be confusing to younger people.
- 45afc4td
-
100+ posts
64-bit integers
Isn't floating point with its significant place rounding even more confusing than unsigned integers with overflow? No support. Scratch is supposed to be simple, that would be confusing to younger people.
- Nambaseking01
-
1000+ posts
64-bit integers
-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?
- WindOctahedron
-
1000+ posts
64-bit integers
Okay, I used the internet to look those up, and that's how I interpret it (I might be completely wrong):-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.
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)
- Flowermanvista
-
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.
- 45afc4td
-
100+ posts
64-bit integers
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.Okay, I used the internet to look those up, and that's how I interpret it (I might be completely wrong):-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.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?
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
-
1000+ posts
64-bit integers
-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.
- Flowermanvista
-
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.
- 45afc4td
-
100+ posts
64-bit integers
Scratch 3.0 is made in WebGL. HTML5 isn't all about JavaScript.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.
- 45afc4td
-
100+ posts
64-bit integers
This is NOT complicated to understand with binary knowledge.-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.
- qucchia
-
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.
I think the best thing you can do is make some custom blocks that do the operations.
- xDcorruptZ
-
48 posts
64-bit integers
it would be used more than 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.
(days since 2000)
Last edited by xDcorruptZ (Nov. 29, 2019 19:01:15)
- 45afc4td
-
100+ posts
64-bit integers
Custom blocks don't return values, they only themselves perform actions so they will further bloat the code. 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.
- Flowermanvista
-
1000+ posts
64-bit integers
WebGL is a graphics API for JavaScript, not a general purpose programming language.Scratch 3.0 is made in WebGL. HTML5 isn't all about JavaScript.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.
- 45afc4td
-
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
-
500+ 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.
Refer to this (thanks @flowermanvista)
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:
Scratch 3.0 is made in WebGL. HTML5 isn't all about JavaScript.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.
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