About 50 results
Open links in new tab
  1. casting - Converting double to integer in Java - Stack Overflow

    Jun 24, 2011 · is there a possibility that casting a double created via Math.round() will still result in a truncated down number No, round() will always round your double to the correct value, and then, it …

  2. Why is casting a const reference directly to a mutable reference ...

    Nov 24, 2018 · The superficial answer to the question "why?" is that these simply are the rules of as expressions in Rust. Quoting from the Nomicon: Casting is not transitive, that is, even if e as U1 as …

  3. Casting objects in Java - Stack Overflow

    Mar 15, 2011 · Casting can be used to clearly state that you are calling a child method and not a parent method. So in this case it's always a downcast or more correctly, a narrowing conversion.

  4. c++ - When should static_cast, dynamic_cast, const_cast, and ...

    The C-style casts can do virtually all types of casting from normally safe casts done by static_cast<> () and dynamic_cast<> () to potentially dangerous casts like const_cast<> (), where const modifier can …

  5. Casting interfaces for deserialization in JSON.NET

    Learn how to cast interfaces for deserialization in JSON.NET with examples and solutions provided by the community on Stack Overflow.

  6. c# - Why should casting be avoided? - Stack Overflow

    Aug 1, 2013 · Bad is a relative term. Avoiding casting is a best-practice, but sometimes a programmer has gotta do what a programmer has got to do. (especially if you writing a java 1.5+ program that …

  7. casting - How to cast or convert an unsigned int to int in C? - Stack ...

    Feb 26, 2011 · The real question is what you want to do when/if the value in the unsigned int it out of the range that can be represented by a signed int. If it's in range, just assign it and you're done. If it's out …

  8. Effect of casting in a C program - Stack Overflow

    Sep 14, 2022 · Casting in C is a rather complex topic with lots of special rules and could easily create bugs or problems in case you aren't aware of them. It's important to know that we can't wildly cast …

  9. casting - Convert boolean to int in Java - Stack Overflow

    Sep 25, 2010 · What is the most accepted way to convert a boolean to an int in Java?

  10. Casting to void* and Back to Original_Data_Type*

    Jul 29, 2025 · Casting to void* removes all type safety. If you use reinterpret_cast or static_cast to cast from a pointer type to void* and back to the same pointer type, you are actually guaranteed by the …