std::float_round_style(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

✨ std::float_round_style βœ¨πŸ’…

okay bestie, real talk: this page comes from the C++ Standard Libary (that's the manual name, we don't argue with it), and it's literally about an enum that tells you which way floating-point math rounds when a result gets stored in a floating-point object. no cap, it's giving "tiny but important" energy πŸŽ€

✨ NAME ✨

std::float_round_style β€” std::float_round_style (yes she named herself, main character behavior πŸ‘‘)

πŸ¦‹ Synopsis πŸ¦‹

Defined in header <limits>
enum float_round_style {

    round_indeterminate       = -1,
    round_toward_zero         = 0,
    round_to_nearest          = 1,
    round_toward_infinity     = 2,
    round_toward_neg_infinity = 3

};

🌸 Description 🌸

so like, enumeration constants of type std::float_round_style indicate the rounding style used by floating-point arithmetic whenever a result of an expression is stored in an object of a floating-point type. the values are:

πŸŽ€ Enumeration constants πŸŽ€

  • std::round_indeterminate β€” rounding style cannot be determined πŸ™ˆ
  • std::round_toward_zero β€” rounding toward zero
  • std::round_to_nearest β€” rounding toward nearest representable value
  • std::round_toward_infinity β€” rounding toward positive infinity
  • std::round_toward_neg_infinity β€” rounding toward negative infinity

🌈 See also 🌈

  • round_style β€” identifies the rounding style used by the type [static] (public static member constant)
  • FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD (C++11) β€” floating-point rounding direction (macro constant)

source/version: http://cppreference.com Β· date: 2024.06.10 β€” stay rounding, bestie, you ate this one πŸ«ΆπŸ’–πŸ”₯

πŸ“¦ where this page comes from