Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
the C++ test case
(w = 86.7, h = 1.7)
was problematic because the orer of operations affected the result. removed.In Rust, there is a distinction between
to_ascii_lowercase
andto_lowercase
.to_ascii_lowercase
is specifically designed for ASCII characters, while to_lowercase is used for Unicode characters.to_lowercase
function should be used for general case conversion of characters, including non-ASCII characters.This is due to the fact that Rust doesn't simplify for you the strings.
"hello world" has obviously 11 characters, but it is not always 8 bit each, hence, the necessity for different methods based on the type.
I'm studying rust, and maybe my explanation it is not 100% correct. The free microsoft course for Rust explains very well strings, but the rust doc go deep inside the problem: https://doc.rust-lang.org/std/primitive.char.html
But there's no harm in doing that.
This comment is hidden because it contains spoiler information about the solution
I've asked my friends, who did same things. I think that just lack of understanding, like "I return 'num' but result of equation is hung in the air... Somewhere".
just seeing it now i thought const int will not be able to store in an int
Just in case a geomagnetic storm happens, and these variables suddenly turn into something else.
This comment is hidden because it contains spoiler information about the solution
Yes, if returning a static label. It points to program data segment.
Why?
(side-note to your answer: are there cases where it cannot be avoided?)
This comment is hidden because it contains spoiler information about the solution
In memory when you store double it's more of an approximation and ONLY accurate to a certain amount of bits like 15 I think? So when you try to use 1.7 * 1.7 its more like 1.6999...55 * 1.69999......5555. As you multiplty things with uncertainty the rate of uncertainty compounds so you're moving up the errors higher and higher to a point where it gets recognzied by the compiler as an actual value.
Atleast I think that's what it is. You can see this if you initialize a double var to a value in something like VS code, when you hover over the var it'll show you a number thats slightly off.
In this exact case std::begin() will just call vector.begin(), so no difference really, only that std::begin() is more generic function.