Anonymous
It's an algorithm I tried writing
Anonymous
And when I use that same algorithm for the code it displays👇
Anonymous
Pavel
it's not related to the algorithm, you have an error in your code (maybe not one). you don't have main function declaration (before your { you need to write int main())
kirito
Is there any one know how to create a sound waves in html like SoundCloud??
Igor🇺🇦
And when I use that same algorithm for the code it displays👇
You should try reading how to write basic program in C++.
Mar!o
Hey guys should I use C++ or C to write a virtual machine? I know both but I just dont know which to use.
Dima
Please is this the right algorithm of this question
I thought you wanted to leave this group
litepresence
We know how to use google
@vms_14 @iamamansharma thanks for help... reviewed all the material and have decided upon a unique method that was not mentioned; as I suspect it will be even faster than any of those provided given my very limited need for precision.
litepresence
if we can accept low precision; we can do this with lookup table for example we only consider first 2 or 3 digits of a number counting from left depending on if odd or even number of digits consider 242,123.56477 int() = 242123 digits = even so consider leading two digits only; 240000 sqrt(24) * sqrt(10000) first part (24) can be in lookup table 10-999. second part also can be in lookup table 10^n such than n is even floor_sqrt = lookup_sqrt(24) * lookup_sqrt(10000) = 4.89 * 100 = 489 true_sqrt(242,123.56477) = 492.06052958 consider a second possibility... 114,465,159.65457 int() = 114465159 digits 9 = odd, so split at first three digits lookup_sqrt(114) * lookup_sqrt(1000000) floor_sqrt = 10.67 * 1000 = 10670 true_sqrt(114,465,159.65457) = 10,698.83917323 that should be hella-efficient :D
litepresence
I'm a python dev not a c++ dev... so I intend to script it up in python first. Then... as I'd really like to become more proficient w/ c++; I'll see what I can stir up :D
litepresence
:D
litepresence
a little bit more lossy... but reduces the lookup table size by a factor of 5; you can lookup 10-99 counting by ones and 100-990 counting by tens for part A
Akash
Can anyone explain how this is going for infinite loop
litepresence
char ?
Asdew
Can anyone explain how this is going for infinite loop
It goes to 127, then overflows to -128 due to the variable being a signed char.
Akash
Ohh okay.
Akash
char ?
It was a que, i did not define like that.
Anonymous
Nicolo'
Guys anybody here that is an EN mothertongue can help me? It will take 30 secs
Akash
They comes 0 to 127 char values
No for that you should define like '0' , Asdew gave the right ans
litepresence
Great. I'll contact you when I need help with python.
python mockup of lossy square root https://hastebin.com/tilirutuxi.py
Anonymous
No for that you should define like '0' , Asdew gave the right ans
But you define x=0 so they start 0 and end of loop x=127
Scor
What is ctype.h and string.h?
Scor
headers
İ know but why when we use them, for what? İ must write comment about them
Dima
learn some more c basics. these are headers, they contain declaration
Dima
İ need just 2-3 words about them
they contain declaration
Asdew
Just one member away from 10000 members...
Dima
holy
Anonymous
İ know but why when we use them, for what? İ must write comment about them
Ctype.h is a header file containing character related declarations. string.h is a header file having declarations related to manipulations on array of characters.
Anonymous
Similar to how stdio.h makes the input output related declarations available to you
Dima
strange explanation
Dima
do you need to know what are headers or just specific files?
Anonymous
Maybe his question was specific to those header files and what do they provide.
Dima
lol
Asdew
10000 members!
Erikoisjääkäri
Hello
litepresence
say something impressive Roy
Johnz
Why Python group has so much more members?
Johnz
Easy to learn?
litepresence
no gateway bot with admin privs
Erikoisjääkäri
say something impressive Roy
I do not know what impressive I could say...
Dima
Easy to learn?
yeah, you can be a monkey to learn python
Dima
creates some hype around, attracts noobs
Dima
Congratulations! you won a helicopter for being a 10000th member!
Dima
Anonymous
Congratulations! you won a helicopter for being a 10000th member!
I'll give it to him, just give me the keys
Anonymous
But, if I leave and enter again
Anonymous
I'll win the prize :D
Rb
Can you advice a c programming books it have questions algorithms and examples please
litepresence
I'll try this. Thank you
https://hastebin.com/tapitoqagu.cpp
litepresence
lossy sqrt; qualitatively my first cpp contribution to the world :D
Pablo humano
Anyone know, how is the function to transform a string in a int variable?
Dima
or atol(), if it is long type
litepresence
hmmm what is difference between that and stoi ?
Pablo humano
atoi()
Thank very much
Pablo humano
And this function stay in string library or in another
litepresence
https://stackoverflow.com/questions/20583945/what-is-the-difference-between-stdatoi-and-stdstoi#20585402
litepresence
I'll try this. Thank you
yeah so... timed it... mine sucks, very slow; lol
ZukiZest
only sintaxe is weird
Anonymous
Anonymous
Hello
litepresence
thanks.
posted also a version in my crude c++ it... it was very slow... probably my implementation. its about 15 posts up in hastebin. send pm pls if you uncover something working that beats cmath sqrt
ZukiZest
Igor🇺🇦
posted also a version in my crude c++ it... it was very slow... probably my implementation. its about 15 posts up in hastebin. send pm pls if you uncover something working that beats cmath sqrt
This program is supper inefficient. You create new lookup table every call, you translate int to string and back for some reason in your loss_sqrt. These operatipnd require memory allocations. Of course regular std::sqrt is faster
NXiss7
only sintaxe is weird
Are you serious? Do you know about high-level features of C++?
Anonymous
Are you serious? Do you know about high-level features of C++?
This C++ it suport for work Class and Object Oriented Programming