#rustchallenge β Public Fediverse posts
Live and recent posts from across the Fediverse tagged #rustchallenge, aggregated by home.social.
-
π¦#RustChallenge
This will throw a compilation error
Fix this code in a short or better way
(Btw, this might compile in the future and work. Because, It was said that shortcomings of rustc & will be fixed in future)
#rustlang #rust -
π¦#RustChallenge
This will throw a compilation error
Fix this code in a short or better way
(Btw, this might compile in the future and work. Because, It was said that shortcomings of rustc & will be fixed in future)
#rustlang #rust -
π¦#RustChallenge
This will throw a compilation error
Fix this code in a short or better way
(Btw, this might compile in the future and work. Because, It was said that shortcomings of rustc & will be fixed in future)
#rustlang #rust -
π¦#RustChallenge
This will throw a compilation error
Fix this code in a short or better way
(Btw, this might compile in the future and work. Because, It was said that shortcomings of rustc & will be fixed in future)
#rustlang #rust -
π¦#RustChallenge
This will throw a compilation error
Fix this code in a short or better way
(Btw, this might compile in the future and work. Because, It was said that shortcomings of rustc & will be fixed in future)
#rustlang #rust -
What will be result?
A. Both X & Y will give error
B. Y will give error & X will print "Kernel" and "Astra"
C. X will print "Kernel" & Y will print "Kernel" and "Astra"
D. both prints "Kernel" & "Astra"(it was shared in ThePrimeagen stream by one of viewers)
-
What will be result?
A. Both X & Y will give error
B. Y will give error & X will print "Kernel" and "Astra"
C. X will print "Kernel" & Y will print "Kernel" and "Astra"
D. both prints "Kernel" & "Astra"(it was shared in ThePrimeagen stream by one of viewers)
-
What will be result?
A. Both X & Y will give error
B. Y will give error & X will print "Kernel" and "Astra"
C. X will print "Kernel" & Y will print "Kernel" and "Astra"
D. both prints "Kernel" & "Astra"(it was shared in ThePrimeagen stream by one of viewers)
-
What will be result?
A. Both X & Y will give error
B. Y will give error & X will print "Kernel" and "Astra"
C. X will print "Kernel" & Y will print "Kernel" and "Astra"
D. both prints "Kernel" & "Astra"(it was shared in ThePrimeagen stream by one of viewers)
-
What will be result?
A. Both X & Y will give error
B. Y will give error & X will print "Kernel" and "Astra"
C. X will print "Kernel" & Y will print "Kernel" and "Astra"
D. both prints "Kernel" & "Astra"(it was shared in ThePrimeagen stream by one of viewers)
-
π¦ #RustChallenge
Will it print Hello World?
A. No, it will give compilation error
B. Yes, it will print `Hello World`
C. No, it will panic at runtime but prints 1
This challenge was brought to you by @tuxmain
-
π¦ #RustChallenge
Will it print Hello World?
A. No, it will give compilation error
B. Yes, it will print `Hello World`
C. No, it will panic at runtime but prints 1
This challenge was brought to you by @tuxmain
-
π¦ #RustChallenge
Will it print Hello World?
A. No, it will give compilation error
B. Yes, it will print `Hello World`
C. No, it will panic at runtime but prints 1
This challenge was brought to you by @tuxmain
-
π¦ #RustChallenge
Will it print Hello World?
A. No, it will give compilation error
B. Yes, it will print `Hello World`
C. No, it will panic at runtime but prints 1
This challenge was brought to you by @tuxmain
-
π¦ #RustChallenge
Will it print Hello World?
A. No, it will give compilation error
B. Yes, it will print `Hello World`
C. No, it will panic at runtime but prints 1
This challenge was brought to you by @tuxmain
-
-
-
-
-
@AstraKernel I have a #RustChallenge for you.
What will be the output of the following code:
- A) nothing, it's not valid rust code π
- B) nothing, it will crash runtime π©
- D) something nice π»
- E) undefined behavior π
#rust #cpp #unsafe #gnu #crablang #imsorry #nice -
@AstraKernel I have a #RustChallenge for you.
What will be the output of the following code:
- A) nothing, it's not valid rust code π
- B) nothing, it will crash runtime π©
- D) something nice π»
- E) undefined behavior π
#rust #cpp #unsafe #gnu #crablang #imsorry #nice -
@AstraKernel I have a #RustChallenge for you.
What will be the output of the following code:
- A) nothing, it's not valid rust code π
- B) nothing, it will crash runtime π©
- D) something nice π»
- E) undefined behavior π
#rust #cpp #unsafe #gnu #crablang #imsorry #nice -
@AstraKernel I have a #RustChallenge for you.
What will be the output of the following code:
- A) nothing, it's not valid rust code π
- B) nothing, it will crash runtime π©
- D) something nice π»
- E) undefined behavior π
#rust #cpp #unsafe #gnu #crablang #imsorry #nice -
@AstraKernel I have a #RustChallenge for you.
What will be the output of the following code:
- A) nothing, it's not valid rust code π
- B) nothing, it will crash runtime π©
- D) something nice π»
- E) undefined behavior π
#rust #cpp #unsafe #gnu #crablang #imsorry #nice -
π¦ #RustChallenge
What will be the output in "Nightly"?
A. Compilation error (already mentioned nightly so it might run, but will you trust me? π)
B. prints "return"
C. prints "!"
D. prints nothing
It's been a long time since I posted (found this in discord)
-
π¦ #RustChallenge
What will be the output in "Nightly"?
A. Compilation error (already mentioned nightly so it might run, but will you trust me? π)
B. prints "return"
C. prints "!"
D. prints nothing
It's been a long time since I posted (found this in discord)
-
π¦ #RustChallenge
What will be the output in "Nightly"?
A. Compilation error (already mentioned nightly so it might run, but will you trust me? π)
B. prints "return"
C. prints "!"
D. prints nothing
It's been a long time since I posted (found this in discord)
-
π¦ #RustChallenge
What will be the output in "Nightly"?
A. Compilation error (already mentioned nightly so it might run, but will you trust me? π)
B. prints "return"
C. prints "!"
D. prints nothing
It's been a long time since I posted (found this in discord)
-
π¦ #RustChallenge
What will be the output in "Nightly"?
A. Compilation error (already mentioned nightly so it might run, but will you trust me? π)
B. prints "return"
C. prints "!"
D. prints nothing
It's been a long time since I posted (found this in discord)
-
-
-
-
-
-
π¦ #RustChallenge:
What is the output?
A. Both X and Y prints "True" and "False"
B.
Only Y prints "True" and "False"
X just prints "False"C. Gives compilation error
D. Runtime error
i know i know, sorry... :P
-
π¦ #RustChallenge:
What is the output?
A. Both X and Y prints "True" and "False"
B.
Only Y prints "True" and "False"
X just prints "False"C. Gives compilation error
D. Runtime error
i know i know, sorry... :P
-
π¦ #RustChallenge:
What is the output?
A. Both X and Y prints "True" and "False"
B.
Only Y prints "True" and "False"
X just prints "False"C. Gives compilation error
D. Runtime error
i know i know, sorry... :P
-
π¦ #RustChallenge:
What is the output?
A. Both X and Y prints "True" and "False"
B.
Only Y prints "True" and "False"
X just prints "False"C. Gives compilation error
D. Runtime error
i know i know, sorry... :P
-
π¦ #RustChallenge:
What is the output?
A. Both X and Y prints "True" and "False"
B.
Only Y prints "True" and "False"
X just prints "False"C. Gives compilation error
D. Runtime error
i know i know, sorry... :P
-
π¦#RustChallenge
What is the output?
A. Prints memory address 3 times
B.
"Rust"
Memory Address
Memory AddressC.
"R"
"u"
"st"D.
"Rust"
"Rust"
"Rust" -
π¦#RustChallenge
What is the output?
A. Prints memory address 3 times
B.
"Rust"
Memory Address
Memory AddressC.
"R"
"u"
"st"D.
"Rust"
"Rust"
"Rust" -
π¦#RustChallenge
What is the output?
A. Prints memory address 3 times
B.
"Rust"
Memory Address
Memory AddressC.
"R"
"u"
"st"D.
"Rust"
"Rust"
"Rust" -
π¦#RustChallenge
What is the output?
A. Prints memory address 3 times
B.
"Rust"
Memory Address
Memory AddressC.
"R"
"u"
"st"D.
"Rust"
"Rust"
"Rust" -
π¦#RustChallenge
What is the output?
A. Prints memory address 3 times
B.
"Rust"
Memory Address
Memory AddressC.
"R"
"u"
"st"D.
"Rust"
"Rust"
"Rust" -
β¨ Rust challenge explained
Ans: C. It never reaches the prints statement. It goes in an infinite loop π²
But, how? Let's break down
π End value is 0xfffffff which is 268435455.0. it is not very important here. So let's remove it and simplify the code with a constant 20,000,000.0 end value
π `f` value stops increasing(round upped) after value 16777216.0 when you add just 1.0 π€―
π To know why,you have to understand how the f32 is stored. Float is not stored as simple as integer
π f32 uses IEEE 754 format to store the value
π Larger f32 number loses accuracy
In a 32 bit float (any language not just rust):
π 1st bit is used for sign identification (positive or negative)
π Following 8 bits used for exponent
π Next 23 bits used for storing mantissa πYou can see more here, how it is calculated
https://youtu.be/8afbTaA-gOQ(Continued π)
-
β¨ Rust challenge explained
Ans: C. It never reaches the prints statement. It goes in an infinite loop π²
But, how? Let's break down
π End value is 0xfffffff which is 268435455.0. it is not very important here. So let's remove it and simplify the code with a constant 20,000,000.0 end value
π `f` value stops increasing(round upped) after value 16777216.0 when you add just 1.0 π€―
π To know why,you have to understand how the f32 is stored. Float is not stored as simple as integer
π f32 uses IEEE 754 format to store the value
π Larger f32 number loses accuracy
In a 32 bit float (any language not just rust):
π 1st bit is used for sign identification (positive or negative)
π Following 8 bits used for exponent
π Next 23 bits used for storing mantissa πYou can see more here, how it is calculated
https://youtu.be/8afbTaA-gOQ(Continued π)
-
β¨ Rust challenge explained
Ans: C. It never reaches the prints statement. It goes in an infinite loop π²
But, how? Let's break down
π End value is 0xfffffff which is 268435455.0. it is not very important here. So let's remove it and simplify the code with a constant 20,000,000.0 end value
π `f` value stops increasing(round upped) after value 16777216.0 when you add just 1.0 π€―
π To know why,you have to understand how the f32 is stored. Float is not stored as simple as integer
π f32 uses IEEE 754 format to store the value
π Larger f32 number loses accuracy
In a 32 bit float (any language not just rust):
π 1st bit is used for sign identification (positive or negative)
π Following 8 bits used for exponent
π Next 23 bits used for storing mantissa πYou can see more here, how it is calculated
https://youtu.be/8afbTaA-gOQ(Continued π)
-
β¨ Rust challenge explained
Ans: C. It never reaches the prints statement. It goes in an infinite loop π²
But, how? Let's break down
π End value is 0xfffffff which is 268435455.0. it is not very important here. So let's remove it and simplify the code with a constant 20,000,000.0 end value
π `f` value stops increasing(round upped) after value 16777216.0 when you add just 1.0 π€―
π To know why,you have to understand how the f32 is stored. Float is not stored as simple as integer
π f32 uses IEEE 754 format to store the value
π Larger f32 number loses accuracy
In a 32 bit float (any language not just rust):
π 1st bit is used for sign identification (positive or negative)
π Following 8 bits used for exponent
π Next 23 bits used for storing mantissa πYou can see more here, how it is calculated
https://youtu.be/8afbTaA-gOQ(Continued π)
-
β¨ Rust challenge explained
Ans: C. It never reaches the prints statement. It goes in an infinite loop π²
But, how? Let's break down
π End value is 0xfffffff which is 268435455.0. it is not very important here. So let's remove it and simplify the code with a constant 20,000,000.0 end value
π `f` value stops increasing(round upped) after value 16777216.0 when you add just 1.0 π€―
π To know why,you have to understand how the f32 is stored. Float is not stored as simple as integer
π f32 uses IEEE 754 format to store the value
π Larger f32 number loses accuracy
In a 32 bit float (any language not just rust):
π 1st bit is used for sign identification (positive or negative)
π Following 8 bits used for exponent
π Next 23 bits used for storing mantissa πYou can see more here, how it is calculated
https://youtu.be/8afbTaA-gOQ(Continued π)
-
π¦ an Interesting #RustChallenge given by @sombrastudios
What will happen?
A) prints "Hello World" instantly
B) prints "Hello World" after 3 seconds
C) never reaches the print statement
D) Compilation error