So I made some blocks that use π so I was wondering if this can become a library? I put this in advanced topics because it has PI.
it has all the PI things I made
.
So I made some blocks that use π so I was wondering if this can become a library? I put this in advanced topics because it has PI.
it has all the PI things I made
.
Hi, welcome to Snap!.
I’m guessing that you came to us from Scratch, because you don’t seem to know that you can make custom reporter blocks as well as custom command blocks. When you’re doing numerical computations, it’s better to REPORT the result rather than SAY it, because that allows the user of your block to use it in a larger computation:
Also, you can give your custom blocks inputs, allowing more interesting computations:
Ok sounds great. Yes I did come from scrach
I may use variables to show the data I don’t know if its possible.
I noticed that you did change it to report the value, but I also noticed that you didn’t change the block type to be reporters. To do that, just open the block editor, click on the hat (not on a label part), and then change the block type. You also have to make sure that the block is not used anywhere in order to change it.
One note on the round block, there’s literally no need to include a million digits of pi (I didn’t count the amount, so I’m probably wrong about the number), because rounding only looks at the first digit after the decimal point.
no used 100,000 found out there is a better way and may be useless on using 100,000 you are right.
Floating point (decimal fraction) computer arithmetic can only represent about 15 digits of precision, so that’s 99,985 digits more than you need. :~)
bh you are right well can use only 15 and what is snapblocks this mean that snap was made with JS of course but just gonna keep the digits.
this mean that snap was made with JS of course
I’m not sure what the “this” was meant to refer to, but the limitation to 15 digits of precision isn’t just in JS; it’s universal in modern computer hardware.
dude
![]()
would be perfect for a useful block I’ll ask about it on that thread
You can use the “radius” variable directly, no need for ask:
(It doesn’t use the variable anyways???)
In more advanced programming languages, there are quadruple precision floating point (from what I’ve seen called a ‘long double’) which are 128 bit and support 34 digits!
Huh. Okay, but I think you mean “more advanced hardware”; the programming language doesn’t affect the floating point format. (Although there are also variable-precision floating point libraries that do the computations in software, I think, as many digits as you want.)
ya it does not work can’t delete it
unicode Math.PI As Letter
I can’t find a way to delete it.
Then I just find a way
I should improve this
say (This won't work)
That’s what I did for unicode PI as letter.
But not with a variable.

um this is the report block so I guess this is how we use report blocks
I think you would benefit from reading the first chapter of the Reference Manual.
ok but its late.